Forums / Developer / Error fetching attribute list

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

eZ debug

Timing: Jan 18 2025 18:39:28
Script start
Timing: Jan 18 2025 18:39:28
Module start 'content'
Timing: Jan 18 2025 18:39:28
Module end 'content'
Timing: Jan 18 2025 18:39:28
Script end

Main resources:

Total runtime0.0614 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.7109180.8359
Module start 'content' 0.00640.0471 768.546993.9922
Module end 'content' 0.05350.0078 862.539170.7031
Script end 0.0613  933.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00223.6164120.0002
Check MTime0.00111.7245120.0001
Mysql Total
Database connection0.00061.025710.0006
Mysqli_queries0.00294.758240.0007
Looping result0.00000.024520.0000
Template Total0.007311.910.0073
Template load0.00101.646110.0010
Template processing0.006310.224910.0063
Override
Cache load0.00071.113510.0007
General
dbfile0.00060.9026100.0001
String conversion0.00000.009730.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs