eZ Community » Forums » Setup & design » fetch_alias and...
expandshrink

fetch_alias and Constant[attribute_filter]

fetch_alias and Constant[attribute_filter]

Friday 11 April 2008 10:05:09 am - 2 replies

Hi,

I replaced the following fetch function :

{def $archived_news=fetch( 'content', 'list',
       hash( 'parent_node_id', ezini( 'SiteSettings', 'SubsiteRootNode', 'dnm_website.ini' ),
             'class_filter_type', 'include',
             'class_filter_array', array( 'news_text' ),
             'depth', '3',
             'sort_by', array( 'attribute', false(), 231 ),
             'attribute_filter', array( 'and',
                                        array( 231, '>', $archiveStartDate ),
                                        array( 231, '<', $archiveEndDate ),
                                        array( 263, '=', '1' ) ) ) )}

by a fetch_alias.

This following fetch_alias function is working :

{def $archived_news=fetch_alias( 'news_text_month_list',
                                                 hash( 'parent_node_id', ezini( 'SiteSettings', 'SubsiteRootNode', 'dnm_website.ini' ),
                                                          'attribute_filter', array( 'and',
                                        array( 231, '>', $archiveStartDate ),
                                        array( 231, '<', $archiveEndDate ),
                                        array( 263, '=', '1' ) ) ) )}

with the fetch_alias override :

[news_text_month_list]
Module=content
FunctionName=list
Constant[sort_by]=attribute;0;231
Constant[class_filter_type]=include
Constant[class_filter_array]=news_text
Constant[depth]=3

However, I need to export the attribute_filter

array( 263, '=', '1' )

to the override rule like something like that

Constant[attribute_filter]=263;=;1

But, i have this fatal error:

Fatal error: Cannot unset string offsets in /var/www/ezpublish-fabien/kernel/classes/ezcontentobjecttreenode.php on line 980
Fatal error: eZ Publish did not finish its request

The execution of eZ Publish was abruptly ended, the debug output is present below.

How can i do this override ?

Monday 24 November 2008 10:49:22 am

Did you find any solution to this problem ? I'm trying to declare a constant attribute_filter on a fetch_alias as well. No success so far and no clue in any documentation.

Modified on Monday 24 November 2008 10:49:43 am by Olivier Clavel

Monday 25 March 2013 11:47:04 am

Hello,

I have the same question : how to set an attribute_filter in fetch_alias constant ?

I tried this :

 Constant[attribute_filter]=saison/validation;=;current

but it looks like the first array level is missing. The filter does not work and I get this error :

Error: eZContentObjectTreeNode::createAttributeFilterSQLStrings Mar 25 2013 11:43:14
$attributeFilter needs to be an array
expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from