Forums / Developer / is this bug in sql query ?

is this bug in sql query ?

Author Message

Selmah Maxim

Sunday 24 August 2003 3:11:16 am

Hi ..

After I have tried every thing to list the data by class attribute i gived up, becuz i get duplicated values when I add the transaltion, so I start with new way to list, by adding 'attribute_filter' , but I get no result, and after checking the sql debug I found sql query error, there is table query is missing, here is the debug :

_________________
Query error: Unknown table 'a0' in where clause. Query: 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 a1
WHERE
path_string like '/1/2/43/46/47/%' and depth <= 5 and

a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 207 AND
a0.version = ezcontentobject_name.content_version AND a1.version = ezcontentobject_name.content_version AND ( a0.sort_key = '1' AND a1.sort_key = '1' ) AND
ezcontentclass.version=0 AND
node_id != 47 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND
( ezcontentobject.contentclass_id = '15' ) 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'
ORDER BY path_string ASC
______________
where is the a0 alias in the query ?

the attribute ids is right, and here ismy tmp code :

-----------------
{let
FirstAds=fetch('content','list',hash(parent_node_id,$node.node_id,
class_filter_type, "include",
class_filter_array, array($CompanyDataClassID),
attribute_filter,
array( 'and', array( 207, '=', '1' ),
array( 159, '=', '1' ) )
))
} {* 207 is first_ad_view , 159 is company_status values *}

{section loop=$FirstAds sequence=array(bglight,bgdark) name=Ads}
{node_view_gui view=first_ad content_node=$Ads:item}
{/section}

{/let}
--------------------------

maybe this fixed in the new revision, cuz this copy is old I think is 29xx .. Idon`t remeber, so plz confirm this to upgarde my copy !

thx in advance !

Jan Borsodi

Thursday 28 August 2003 5:34:32 am

I think there is a bug in the new attribute filtering/sorting that causes it, we will look into this.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq