Problem with fetch function with filter_attribute on a selection datatype attribute

Author Message

Veronique Jamilloux

Friday 21 January 2011 7:43:29 am

Hi,

I'm using eZpublish 4.2.

I create a class with a selection attribute named PublicationType, There are 6 elements in this attribute 'ACL', 'ACT', 'INV', 'COM', 'DEMO', 'SPM', 'Thesis'.

I create different 14 objects, 2 by 'PublicationType'

In my template I use this fetch function :

{set $children=fetch('content','list',hash('parent_node_id', $node.parent_node_id,
'offset', $view_parameters.offset,
'attribute_filter', array( 'and', array('urgi_publication/publish_date', 'between', array( $timeCurrentYear, $timeNextYear)),
array('urgi_publicationPublicationType','=',3)),
'sort_by', array('attribute',false(),'urgi_publication/publish_date'),
'limit', $page_limit))}

I've got two objects where PublicationType corresponding to 'INV', Good!

with this fetch

{set $children=fetch('content','list',hash('parent_node_id', $node.parent_node_id,
'offset', $view_parameters.offset,
'attribute_filter', array( 'and', array('urgi_publication/publish_date', 'between', array( $timeCurrentYear, $timeNextYear)),
array('urgi_publicationPublicationType','=',2)),
'sort_by', array('attribute',false(),'urgi_publication/publish_date'),
'limit', $page_limit))}

I've got two objects where PublicationType corresponding to 'COM', Good!!!!

But when I put array('urgi_publicationPublicationType','=',1) or array('urgi_publicationPublicationType','=',0)

I've got nothing!!!! Idem when I put array('urgi_publicationPublicationType','=',4) and so on!!!

Is there a mistake in my fetch function? or is there a bug ? I read a similary problem in this topic :

http://share.ez.no/forums/developer/attribute_filter-ezselection/%28language%29/eng-GB

Thank you for your reply

VĂ©ronique

URGI - INRA
Webmaster
Route de Saint Cyr
78000 Versailles

Gaetano Giunta

Friday 21 January 2011 10:27:21 am

It is probably only a cpy-and-paste error, but array('urgi_publicationPublicationType','=',0) should be array('urgi_publication/publication_type','=',0) ?

Principal Consultant International Business
Member of the Community Project Board

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