Forums / Developer / help on attribute_filter

help on attribute_filter

Author Message

Eric Bourgain

Thursday 08 June 2006 8:40:38 am

Hi everybody,

I have a problem with an attribute filter that I do not understand. I suppose it's something obvious, but I can't see it.

I call a fetch with the following code:
{set $list_items=fetch('content', 'list,
hash('parent_node_id', $node.node_id,
'offset', $view_parameters.offset,
'attribute_filter', $filter,
'sort_by', array('attribute',true(),'iag_agenda_event/iag_start_date'),
'limit', $page_limit,
'class_filter_array', array('iag_agenda_event'),
'class_filter_type', 'include'))}

if I print the value of $filter, I get:
{$filter|attribute(show,5)} =>
0 string 'and'
1 array Array(3)
>0 string 'or'
>1 array Array(3)
>>0 string 'iag_agenda_event/iag_end_date'
>>1 string '>='
>>2 integer 1149780321
>2 array Array(3)
>>0 string 'iag_agenda_event/iag_start_date'
>>1 string '>='
>>2 integer 1149780321
That I translate by:
and(or(('iag_agenda_event/iag_end_date', '>=', 1149780321),
('iag_agenda_event/iag_start_date', '>=', 1149780321)))

If I list the only child of my object, and print the values of the attributes:
{$evt.object.data_map.iag_start_date.content.timestamp} => 1149976800
{$evt.object.data_map.iag_end_date.content.timestamp} =>1149976800

for me, if I replace in the formula, I get
and(or((1149976800, '>=', 1149780321),
(1149976800, '>=', 1149780321)))
that is true. I should get my object

But I get nothing!! I've tried many things. The only way it works is when I remove the attribute_filter line.
Any idea? Where is the thing I haven't understood?

Regards

Eric

PS: I use eZ 3.6.7

Kristof Coomans

Thursday 08 June 2006 10:14:26 am

Hi Eric

I'm afraid you can't nest conditions in the attribute_filter.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Eric Bourgain

Friday 09 June 2006 4:47:52 am

Hi,

That's a pity. Because of this, I will have to make madatory the value of some field...

But it does not work either.
When I print my filter, now, I have:
0 string 'and'
1 array Array(3)
>0 string 'iag_agenda_event/iag_end_date'
>1 string '>='
>2 integer 1149853074

And it does not return anything.
Any other idea?
Thanx

Eric

eZ debug

Timing: Jan 18 2025 15:18:49
Script start
Timing: Jan 18 2025 15:18:49
Module start 'content'
Timing: Jan 18 2025 15:18:50
Module end 'content'
Timing: Jan 18 2025 15:18:50
Script end

Main resources:

Total runtime1.3106 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0090 588.8438180.8359
Module start 'content' 0.00901.1109 769.6797552.1484
Module end 'content' 1.11980.1907 1,321.8281332.7500
Script end 1.3105  1,654.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3173210.0002
Check MTime0.00140.1102210.0001
Mysql Total
Database connection0.00080.060110.0008
Mysqli_queries1.236394.32811940.0064
Looping result0.00220.16941920.0000
Template Total1.274697.320.6373
Template load0.00190.146420.0010
Template processing1.272797.105620.6363
Template load and register function0.00010.010210.0001
states
state_id_array0.00090.072310.0009
state_identifier_array0.00120.088920.0006
Override
Cache load0.00170.1276600.0000
Sytem overhead
Fetch class attribute can translate value0.00160.124630.0005
Fetch class attribute name0.00140.105340.0003
XML
Image XML parsing0.00090.066930.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00290.2250270.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs