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

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

eZ debug

Timing: Jan 18 2025 20:59:38
Script start
Timing: Jan 18 2025 20:59:38
Module start 'layout'
Timing: Jan 18 2025 20:59:38
Module start 'content'
Timing: Jan 18 2025 20:59:39
Module end 'content'
Timing: Jan 18 2025 20:59:39
Script end

Main resources:

Total runtime0.6583 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 587.9141152.6250
Module start 'layout' 0.00430.0022 740.539139.4453
Module start 'content' 0.00650.6503 779.9844540.2734
Module end 'content' 0.65680.0015 1,320.257812.1641
Script end 0.6582  1,332.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4464160.0002
Check MTime0.00120.1860160.0001
Mysql Total
Database connection0.00050.081410.0005
Mysqli_queries0.612293.0036570.0107
Looping result0.00050.0818550.0000
Template Total0.631595.920.3158
Template load0.00170.264720.0009
Template processing0.629795.661720.3149
Template load and register function0.00010.015410.0001
states
state_id_array0.00070.107210.0007
state_identifier_array0.00150.221920.0007
Override
Cache load0.00150.2221260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.106420.0004
Fetch class attribute name0.00130.193240.0003
XML
Image XML parsing0.00070.112620.0004
class_abstraction
Instantiating content class attribute0.00000.002050.0000
General
dbfile0.00080.1212180.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs