What the error with this fetch .. please !!

Author Message

Selmah Maxim

Sunday 15 January 2006 3:27:10 am

Hi ...


$xx=fetch( content, tree,
			hash( parent_node_id, 84,depth,0,
					'limit',50,
					offset, $view_parameters.offset,
				  class_filter_type, include,
				  class_filter_array, array( 16 ),
				  attribute_filter, array(array('265','=','0'))
				   ) )

fetcging by enum value, class 16 ... problem i get no sql debug if there is ' attribute_filter' ... when I remove I get normal sql debug ... with attribute_filter result 0 ... but its not right ... .

what to do please ... spending alot of time on last step ... any way to do attribute_filter on enum value !!

Thanks in advance.

Norman Leutner

Sunday 15 January 2006 4:44:08 am

attribute_filter, array(array('265','=','0')) 

Is your attribute boolean?

Then I would use:

attribute_filter, array( array ('265', '=' , false() ) 

or

attribute_filter, array( array ('265', '!= , true() )

otherwise try:

attribute_filter, array( array ('265', '=' , '' )

to select nodes, which have no attribute value

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Sunday 15 January 2006 9:14:42 am

Ok, I tried it with a numeric field and also got no result.....

{def $count=fetch( 'content', 'tree_count',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                          attribute_filter, array( array('projekt/leader_id', '=', '1320' ) ),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'projekt' ) ) )}

Seems to be a bug within ez...

Version: 3.7.0 (3.7.0)
SVN Revision: 13286

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Kristof Coomans

Sunday 15 January 2006 11:25:33 am

I think the first entry in your attribute_filter array needs to be the string 'and' or 'or':

{def $count=fetch( 'content', 'tree_count',
                           hash( 'parent_node_id', '2',
                                    'sort_by', array( 'published', false() ),
                                    'class_filter_type', 'include',
                                    'class_filter_array', array( 'projekt' ),
                                    'attribute_filter', array( 'and', array( 'projekt/leader_id', '=', '1320' ) ) ) )}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Sunday 15 January 2006 11:31:34 am

Please ignore my previous reply. If the first entry in the attribute_filter array isn't a string, then 'and' is used as default.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Paul Borgermans

Sunday 15 January 2006 11:49:04 am

Indeed, 'and' is default if not specified.

What happens when you try this

{def $count=fetch( 'content', 'tree_count',
                  hash( 'parent_node_id','2',
                        'sort_by',array( 'published', false()),
                         attribute_filter, array( array('projekt/leader_id', '=', 1320 )) ))}

In other words, remove the single quotes. Also when you filter on attribute, class filtering is redundant.

hth

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Norman Leutner

Monday 16 January 2006 12:47:30 am

Also returns 0,

I also tried using a string datatype and filtering with 'like'
without any result.

There sems to be a general problem

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Monday 16 January 2006 12:51:05 am

Here the current template code once again:

{def $userid=$user.contentobject_id}

{* Anzahl der beendeten Projekte *}
{def $count=fetch( 'content', 'tree_count',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
                          attribute_filter, array( 'and',
                                                         array('auktion/beendet', '=', true(),
                                                         array('projekt/leader_id', '=', $userid )
                                                       ),
                         'class_filter_type',  'include',
                         'class_filter_array', array( 'auktion' ) ) )}

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Monday 16 January 2006 1:02:07 am

Setting debug on i got:

Error: eZTemplate:def Jan 16 2006 09:55:25 
parser error @ extension/hoppecke/design/plain/override/templates/full/meine_projekte.tpl:12
($) expected at [fetch( 'content', 'tree_count',
                   hash( 'parent_node_id','2',
                         'sort_by',array( 'published', false()),
...

Warning: PHP Jan 16 2006 09:55:25 
array_keys(): The first argument should be an array in /var/www/html/hoppecke/ezp370/var/plain/cache/template/compiled/meine_projekte-88748bf2b4a2fcac02daceb8470ab99a.php on line 200 


Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Valentin Doroschuk

Wednesday 18 January 2006 5:25:37 am

Make sure that your filtered attribute is one of:
- Checkbox
- Date
- Date and time
- E-mail
- Integer
- Object relation
- Selection (will not work when used as multiple selector)
- Text line
- Time

And you should clear those files:
-var/<siteaccess>/cache/sortkey_<your_DB>.php
-var/<siteaccess>/cache/classattributeidentifiers_<your_DB>.php

Norman Leutner

Wednesday 18 January 2006 6:57:59 am

I already checked that.

The attribute type is integer...

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Valentin Doroschuk

Thursday 19 January 2006 12:50:24 am

Have you cleared the files?
and does the attribute_filter still work incorrectly?

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