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.