sort_by on fetch

Author Message

Jean-Luc Nguyen

Tuesday 23 September 2008 8:50:24 am

Hello,

I have a very simple fetch, and I sort by priority :

{foreach fetch( 'content', 'list', hash('parent_node_id', 2,
   'class_filter_type', 'include',
   'class_filter_array', array( 'frontpage' ) ),
   'sort_by', array( 'priority', true() ) ) as $frontpage}
   {$frontpage.name|wash()}
{/foreach}

But when displaying, it won't sort by priority, but by creation date, I really don't understand...
Some help woold be great, thanks!

http://www.acidre.com

André R.

Tuesday 23 September 2008 11:43:13 am

Might be because you seem to have a parser error in your code, you're missing one ')' after the fetch code.

Edit: move the extra ')' after 'class_filter_array' to after sort parameter.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jean-Luc Nguyen

Wednesday 24 September 2008 2:34:37 am

Great, sometimes you need another eye to see a "bug" that won't display on the debug... Thanks a lot!

http://www.acidre.com

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 15:57:16
Script start
Timing: Jan 18 2025 15:57:16
Module start 'layout'
Timing: Jan 18 2025 15:57:16
Module start 'content'
Timing: Jan 18 2025 15:57:16
Module end 'content'
Timing: Jan 18 2025 15:57:16
Script end

Main resources:

Total runtime0.0186 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.7109152.6094
Module start 'layout' 0.00520.0038 742.320339.4141
Module start 'content' 0.00900.0074 781.734489.4297
Module end 'content' 0.01630.0023 871.164134.3047
Script end 0.0186  905.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002613.8411140.0002
Check MTime0.00126.5190140.0001
Mysql Total
Database connection0.00063.202010.0006
Mysqli_queries0.003317.688830.0011
Looping result0.00000.149610.0000
Template Total0.00189.410.0018
Template load0.00095.047210.0009
Template processing0.00084.318310.0008
Override
Cache load0.00063.351610.0006
General
dbfile0.002211.729980.0003
String conversion0.00000.058840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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