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.

eZ debug

Timing: Jan 18 2025 16:17:55
Script start
Timing: Jan 18 2025 16:17:55
Module start 'layout'
Timing: Jan 18 2025 16:17:55
Module start 'content'
Timing: Jan 18 2025 16:17:57
Module end 'content'
Timing: Jan 18 2025 16:17:57
Script end

Main resources:

Total runtime1.6814 sec
Peak memory usage4,096.0000 KB
Database Queries90

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 588.0156152.6250
Module start 'layout' 0.00910.0046 740.640639.4453
Module start 'content' 0.01371.6659 780.0859786.6250
Module end 'content' 1.67960.0018 1,566.710932.1406
Script end 1.6814  1,598.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2438160.0003
Check MTime0.00150.0888160.0001
Mysql Total
Database connection0.00180.105610.0018
Mysqli_queries1.573793.5921900.0175
Looping result0.00100.0598880.0000
Template Total1.638197.420.8190
Template load0.00210.125820.0011
Template processing1.636097.294820.8180
Template load and register function0.00030.014910.0003
states
state_id_array0.00130.076810.0013
state_identifier_array0.00180.107320.0009
Override
Cache load0.00200.1176780.0000
Sytem overhead
Fetch class attribute can translate value0.00120.070750.0002
Fetch class attribute name0.00180.1061160.0001
XML
Image XML parsing0.00250.151150.0005
class_abstraction
Instantiating content class attribute0.00010.0033230.0000
General
dbfile0.00170.0985350.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
21content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 61
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs