Cannot sort by attribute value and query by another.

Author Message

Jason M

Wednesday 10 December 2003 11:54:04 am

After reviewing the sql that is output by the following fetch:

fetch(content, list,
hash(
parent_node_id, 55,
depth, 3,
offset, $view_parameters.offset,
limit, 1,
attribute_filter, array('and', array('183', '=' , $content_version.data_map.short_name.content)),
sort_by, array(attribute,true(),185)
)
)

I believe this to be a limitation in EZ. Am I wrong by assuming this?

Here is the sql output as well:

SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass
, ezcontentobject_name
, ezcontentobject_attribute as a0


WHERE
path_string like '/1/2/55/%' and depth <= 5 and


a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 185 AND
a0.version = ezcontentobject_name.content_version AND

a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 183 AND
a0.version = ezcontentobject_name.content_version AND
( a0.sort_key_string = 'usedauto' ) AND
ezcontentclass.version=0 AND
node_id != 55 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND

ezcontentobject_tree.contentobject_is_published = 1
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-GB'
AND ((ezcontentobject.contentclass_id in (1,10,11,12,13,14,15,17,19,2,20,21,5,6,7,8,9)))
ORDER BY a0.sort_key_string ASC
LIMIT 0, 1

I am simply trying to query auto rates. I'm looking in the loan rate class for the name attribute = 'usedauto' and hoping to sort by apr and limit 1 to get the lowest rate of the usedautos. The function works when the sort_by and attribute_filter_array are used independently of each other, but not together in the same fetch. Any thoughts?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.