Forums / Developer / Error fetching attribute list

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Error fetching attribute list

Author Message

Marko Žmak

Monday 13 March 2006 6:14:52 am

I found an error in eZ 3.6.1. When I try to fetch attribute list, the attributes are not fetched. In the debug part I get this error:

Query error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''' AND version='0'
ORDER BY placement ASC' at line 6. Query: SELECT id, name, version, contentclass_id, identifier, placement, is_searchable,
is_required, can_translate, is_information_collector, data_type_string, data_int1, data_int2, data_int3,
data_int4, data_float1, data_float2, data_float3, data_float4, data_text1, data_text2,
data_text3, data_text4, data_text5
FROM ezcontentclass_attribute
WHERE contentclass_id58'' AND version='0'
ORDER BY placement ASC

I tried to fetch the attributes like this:

{def $attributes=fetch(class,'attribute_list', hash('class_id', array($create_class.id)))}

Is this error solved in newer versions of eZ or should I report it as a bug?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Bartek Modzelewski

Tuesday 14 March 2006 12:00:02 am

You can't use array() here:

{def $attributes=fetch(class,'attribute_list', hash('class_id', array($create_class.id)))}

Just put class_id as single variable:

{def $attributes=fetch( class, 'attribute_list', hash( 'class_id', $create_class.id ) ) }

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/class/fetch_functions/attribute_list

Baobaz
http://www.baobaz.com

Marko Žmak

Tuesday 14 March 2006 2:44:04 pm

Thanks for the tip I'll use it.

But still, event if the template syntax is wrong, this shouldn't produced the described mysql error but produce a warning. Am I right?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth