Dynamic Data Map Access fails

Author Message

Wenzel Wondra

Monday 06 April 2009 6:52:50 am

Hello,

I have some integer datatypes in my object. They are all named something like "contingent_cat_1", "contingent_cat_2", and so on.

On my test server (PHP 5.2.4-2ubuntu5.5) I can access the values using

{foreach $foo as $bar}
....
{set $idx = inc( $idx )}
{set $contingentCat = concat( 'contingent_cat_', $idx )}
{if gt( $node.object.data_map.$contingentCat.data_int, 0 )}
... 
{/if}
{/foreach}

On the production server (PHP 5.2.0-8+etch13), the same code fails with an
Error: eZTemplate:eZTemplateCompiler
"PHP variable $if_cond1['Array'] does not exist, cannot fetch the value."

Edit:
Also the other syntax $node.object.data_map[$dynamicField].data_int doesn't work...

Any Ideas?

Thanks in advance!
wewo

Edit: Forgot to mention: It's EZP 4.1

Wenzel Wondra

Tuesday 07 April 2009 9:51:06 am

When I use:
$node.data_map.$contingentCat.data_int
instead of
$node.content.data_map.$contingentCat.data_int

Everything works fine on both servers :)

regards,
wewo

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 31 2025 00:30:06
Script start
Timing: Jan 31 2025 00:30:06
Module start 'layout'
Timing: Jan 31 2025 00:30:06
Module start 'content'
Timing: Jan 31 2025 00:30:07
Module end 'content'
Timing: Jan 31 2025 00:30:07
Script end

Main resources:

Total runtime1.3176 sec
Peak memory usage8,192.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.1328151.2109
Module start 'layout' 0.00610.0038 739.3438220.6875
Module start 'content' 0.00991.3069 960.03134,168.3359
Module end 'content' 1.31680.0008 5,128.36727.8516
Script end 1.3176  5,136.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2735160.0002
Check MTime0.00130.0964160.0001
Mysql Total
Database connection0.00080.059210.0008
Mysqli_queries1.244294.4311520.0239
Looping result0.00040.0288500.0000
Template Total1.263595.920.6318
Template load0.00220.163720.0011
Template processing1.261495.731520.6307
Template load and register function0.00120.091010.0012
states
state_id_array0.00130.102310.0013
state_identifier_array0.00180.140320.0009
Override
Cache load0.00180.1370240.0001
Sytem overhead
Fetch class attribute can translate value0.00140.106910.0014
Fetch class attribute name0.00170.131020.0009
XML
Image XML parsing0.00010.006510.0001
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00200.1523100.0002
String conversion0.00000.000640.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/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/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 6

Time used to render debug report: 0.0001 secs