#009321: fetch content search with sort_by failed

Description:

In template, using sort_by on attribute with class_identifier/member syntax in fetch content search failed. It works well with sort_by with attribute_id.


Environment:

Operating System: Linux
PHP Version: 4.4.2
Database and version: MySQL 4.1


Steps to Reproduce:
fetch(content, search, hash(text, 'foo', sort_by, array('attribute', true, 'class_identifier/attribute'))</code>
produces a wrong SQL query. class_identifier/attribute is not replaced by its attribute id.
<code>
Error: eZMySQLDB      Nov 02 2006 10:53:21

Query error: Unknown column 'programme' in 'where clause'. Query: SELECT DISTINCT ezcontentobject.*, ezcontentclass.name as class_name, ezcontentobject_tree.*
                            , ezcontentobject_name.name as name,  ezcontentobject_name.real_translation 
                    FROM
                       ezsearch_tmp__0 ,
                       ezcontentobject,
                       ezcontentclass,
                       ezcontentobject_tree
                       , ezcontentobject_name 
                       , ezcontentobject_attribute as a0
                    WHERE
                     
                    ezcontentobject.id=ezsearch_tmp__0.contentobject_id AND
                    ezcontentobject.contentclass_id = ezcontentclass.id and
                    ezcontentclass.version = '0' and
                    ezcontentobject.id = ezcontentobject_tree.contentobject_id and
                    ezcontentobject_tree.node_id = ezcontentobject_tree.main_node_id
                     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 ) )
 ) 

<code>fetch(content, search, hash(text, 'foo', sort_by, array('attribute', true, 20))</code> works well.


- Attachments

No attachments for this issue.


- Comments

Tested in 3.8.7(stable 3.8, rev 17364)
I've added your example to node/view/full.tpl and there isn't any SQL error.
Maybe you have same additional info for reproducing...
It's a feature actually. If you do this:
I've added like here:


{let $a= fetch(content, search, hash(text, 'foo', sort_by, array('attribute', true, 'class_identifier/attribute'))) }
{$a|attribute(show)}
{/let}<br>

#250131 by Lenara Anafieva on November 6th, 2006 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Misc
Affects 3.8.4
Fix Version -
Reporter Damien Pobel
Responsible -
Status 0 Closed
Resolution Duplicate
Created November 2nd, 2006
Updated March 30th, 2008
Resolved March 30th, 2008
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #019127
  DB Deadlocks on ezcontentobject_tree when updating subnode