Forums / Setup & design / Attribute sorting doesn't work after upgrade ez 3.9 to 3.10

Attribute sorting doesn't work after upgrade ez 3.9 to 3.10

Author Message

Serg Tsay

Tuesday 23 October 2007 8:29:41 pm

Hi.
I have upgraded ezpublish 3.9 to 3.10. And now Attribute sorting doesn't work!

In my template:

{let
children=fetch( 'content', 'list', hash( 'parent_node_id', $node.node_id,
offset, $view_parameters.offset, limit, $lim,
'class_filter_type', 'include',
'class_filter_array', array('news'),
sort_by, array( 'attribute', false(), 'news/date') ))
}
This fetch works fine in 3.9 but won't in 3.10
And next fetch also works in 3.10 :

{let
children=fetch( 'content', 'list', hash( 'parent_node_id', $node.node_id,
offset, $view_parameters.offset, limit, $lim,
'class_filter_type', 'include',
'class_filter_array', array('news'),
sort_by, array( 'published', false()) ))
}

Cache was cleared.

<b>System info:</b>

Version: 3.10.0 (3.10.0)
SVN revision: 20092
Web server: Apache/1.3.34 (Unix) PHP/4.4.1, postgresql

<b>Debug report: (Where: 'news/date' - attribute_id = 190)</b>

Warning: PHP ��� 24 2007 09:23:30
pg_exec(): Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /ezdb/classes/ezpostgresqldb.php on line 164
Notice: eZPostgreSQLDB::query(3.343 ms) query number per page:8 ��� 24 2007 09:23:30
SELECT DISTINCT
ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.serialized_name_list as class_serialized_name_list,
ezcontentclass.identifier as class_identifier,
ezcontentclass.is_container as is_container

, ezcontentobject_name.name as name, ezcontentobject_name.real_translation

FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass
, ezcontentobject_name
, ezcontentobject_attribute a0



WHERE
ezcontentobject_tree.path_string like '/1/2/94/%' and ezcontentobject_tree.depth <= 3 and


a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 190 AND
a0.version = ezcontentobject_name.content_version AND
( a0.language_id & ezcontentobject.language_mask > 0 AND
( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 2 ) )
<
( a0.language_id & 1 )
+ ( ( a0.language_id & 2 ) )
)
AND

ezcontentclass.version=0 AND
ezcontentobject_tree.node_id != 94 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND

ezcontentobject.contentclass_id IN ( 17 ) AND
ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0 AND
( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 2 ) )
<
( ezcontentobject_name.language_id & 1 )
+ ( ( ezcontentobject_name.language_id & 2 ) )
)

AND ezcontentobject_tree.is_invisible = 0


AND
ezcontentobject.language_mask & 3 > 0

ORDER BY a0.sort_key_int DESC
LIMIT 3
Error: eZPostgreSQLDB ��� 24 2007 09:23:30
Error: error executing query: SELECT DISTINCT
ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.serialized_name_list as class_serialized_name_list,
ezcontentclass.identifier as class_identifier,
ezcontentclass.is_container as is_container

, ezcontentobject_name.name as name, ezcontentobject_name.real_translation

FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass
, ezcontentobject_name
, ezcontentobject_attribute a0



WHERE
ezcontentobject_tree.path_string like '/1/2/94/%' and ezcontentobject_tree.depth <= 3 and


a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 190 AND
a0.version = ezcontentobject_name.content_version AND
( a0.language_id & ezcontentobject.language_mask > 0 AND
( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & a0.language_id ) ) & 2 ) )
<
( a0.language_id & 1 )
+ ( ( a0.language_id & 2 ) )
)
AND

ezcontentclass.version=0 AND
ezcontentobject_tree.node_id != 94 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND

ezcontentobject.contentclass_id IN ( 17 ) AND
ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0 AND
( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 2 ) )
<
( ezcontentobject_name.language_id & 1 )
+ ( ( ezcontentobject_name.language_id & 2 ) )
)

AND ezcontentobject_tree.is_invisible = 0


AND
ezcontentobject.language_mask & 3 > 0

ORDER BY a0.sort_key_int DESC
LIMIT 3 ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

Douglas Hammond

Thursday 08 November 2007 10:47:43 am

I can confirm this also.

André R.

Thursday 08 November 2007 11:58:27 am

You should create a bug issue on this, If it haven't been reported in the issue tracker already.

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

Kristof Coomans

Friday 09 November 2007 12:30:07 am

Reported by Douglas here: http://issues.ez.no/11873

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