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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:33:01
Script start
Timing: Jan 18 2025 18:33:01
Module start 'layout'
Timing: Jan 18 2025 18:33:01
Module start 'content'
Timing: Jan 18 2025 18:33:02
Module end 'content'
Timing: Jan 18 2025 18:33:02
Script end

Main resources:

Total runtime0.8654 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.9141152.6250
Module start 'layout' 0.00650.0025 740.539139.4453
Module start 'content' 0.00900.8547 779.9844547.0703
Module end 'content' 0.86380.0016 1,327.054712.1641
Script end 0.8654  1,339.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3886160.0002
Check MTime0.00140.1665160.0001
Mysql Total
Database connection0.00120.141410.0012
Mysqli_queries0.806793.2118570.0142
Looping result0.00080.0910550.0000
Template Total0.833696.320.4168
Template load0.00250.283220.0012
Template processing0.831196.036320.4156
Template load and register function0.00020.017710.0002
states
state_id_array0.00080.096410.0008
state_identifier_array0.00130.145320.0006
Override
Cache load0.00210.2465600.0000
Sytem overhead
Fetch class attribute can translate value0.00070.085720.0004
Fetch class attribute name0.00100.119640.0003
XML
Image XML parsing0.00080.088520.0004
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00130.1530160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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