eZ Community » Forums » General » Sort by attribute trouble
expandshrink

Sort by attribute trouble

Sort by attribute trouble

Wednesday 25 October 2006 6:46:37 pm - 5 replies

Hi,

On few our sites used sorting by attribute like next

$items=fetch_alias(children, hash(parent_node_id, <some_node_id>, sort_by, array('attribute',false,'<class_name>/<some_attribute>'), ...)

<some_attribute> has type ezdate - its work fine on our sites with ez 3.7.6/3.7.9/3.8.3 - but not working on site with ez 3.8.4 !

I'm tried use array('attribute',false(),<attribute_id>blunk.gif Emoticon - but has same result.

Anybody can help me ?

Bye.

Thursday 26 October 2006 10:24:57 am

Hello Denis

Have you enabled debug output, disabled template compile and content view cache?
Did you see any template errors then?

Modified on Thursday 26 October 2006 10:25:11 am by Kristof Coomans

Thursday 26 October 2006 10:48:50 am

Hi,

Yes - I was enabled debug output - but not got any error

Sorting working - but working wrong

IMHO - this is may be bug in PHP code or in the SQL statement

Bye.

Wednesday 01 November 2006 6:21:58 pm

Hi Denis

Enable SQL output and check the query - does the sort parameter appear there? (It might be useful to surround the fetch with a {debug-timing-point id ="foo"} to find the relevant query easier).

If the sort parameter does not appear in the query try with another sort parameter (just by name or so). Also try without using an fetchalias. Any changes?

Greetings from Luxembourg

Claudia

Wednesday 01 November 2006 9:03:31 pm

Hi

4 Claudia Kosny:

I gotta get first upgrade from 3.8.4 -> 3.8.6 - maybe its solve this problem

Bye.

Sunday 30 September 2007 8:13:36 pm

Same or similar prob in 3.9.3

Trying to use a sort array to display sticky news to top of list in fetch_alias. Seems that fetch_alias can't accept an array of arrays for the sort.

This does not work... Empty variable name error.

{set 
list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
           offset, $view_parameters.offset,
           sort_by, array ( array( attribute, false(), 'news/sticky' ), $node.sort_array),
           limit, $page_limit ) ) }

This also does not work...

{set 
list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
          offset, $view_parameters.offset,
          attribute_filter, $time_filter,
          sort_by, array ( array( attribute, false(), 'news/sticky' ),array( 'published', false() ) ),
          limit, $page_limit ) ) }

But, this works...

  {set list_items=fetch_alias( children,hash( 'parent_node_id', $node.node_id,
                                                             'offset', $view_parameters.offset,
                                                             'sort_by', array(array( attribute,false(),'news/sticky' ), array('attribute', false(), 'news/date')),  
                                                             'limit', $page_limit ) ) }

and this works...

{set 
list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
         offset, $view_parameters.offset,
         sort_by, array( attribute, false(), 'news/sticky' ) ,
         limit, $page_limit ) ) }

And this works...

{set 
list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
         offset, $view_parameters.offset,
         sort_by, $node.sort_array,
         limit, $page_limit ) ) }

Modified on Tuesday 09 October 2007 3:58:06 pm by Luc Chase

expandshrink

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

36 542 Users on board!

Forums menu