Sunday 04 May 2008 9:47:25 am
Hi ! I have an article class who has two datetime attributes, one to store the start of the publication and the other to store the end of the publication.
The start_publication attribute is required so he's never empty. The end_publication attribute is not required so he can be blank, and here is my problem. If the two attributes are set, this attribute_filter is working :
'attribute_filter', array(
'and',
array( 'article/start_publication', '<=', $actualtimestamp ),
array( 'article/end_publication', '>', $actualtimestamp )
)
The problem is that if end_publication is blank, objects are not fetched. I have tryied to do this :
'attribute_filter', array(
'or',
array(
'and',
array( 'article/start_publication', '<=', $actualtimestamp ),
array( 'article/end_publication', '>', $actualtimestamp )
),
array(
array( 'article/end_publication', '=', '0' )
)
)
But it doesn't works and I would prefer avoid to develop an extended_attribute_filter if possible... Thanks in advance !
eZ Publish Freelance
web : http://www.webaxis.fr
|