Forums / Developer / What the error with this fetch .. please !!

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?

eZ debug

Timing: Jan 31 2025 01:22:41
Script start
Timing: Jan 31 2025 01:22:41
Module start 'content'
Timing: Jan 31 2025 01:22:41
Module end 'content'
Timing: Jan 31 2025 01:22:41
Script end

Main resources:

Total runtime0.1733 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.9531370.2891
Module start 'content' 0.00640.0099 958.24221,021.6875
Module end 'content' 0.01630.1570 1,979.92973,910.2891
Script end 0.1733  5,890.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00402.3235200.0002
Check MTime0.00130.7230200.0001
Mysql Total
Database connection0.00070.418310.0007
Mysqli_queries0.084348.62071410.0006
Looping result0.00120.66561390.0000
Template Total0.156690.410.1566
Template load0.00070.392310.0007
Template processing0.156089.975410.1560
Override
Cache load0.00040.242810.0004
Sytem overhead
Fetch class attribute can translate value0.00160.945010.0016
XML
Image XML parsing0.00030.161510.0003
General
dbfile0.00895.1250200.0004
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs