Forums / Developer / Dynamic Data Map Access fails

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

eZ debug

Timing: Jan 31 2025 01:20:49
Script start
Timing: Jan 31 2025 01:20:49
Module start 'content'
Timing: Jan 31 2025 01:20:49
Module end 'content'
Timing: Jan 31 2025 01:20:49
Script end

Main resources:

Total runtime0.2438 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 587.9297370.2969
Module start 'content' 0.00790.0192 958.22661,001.5313
Module end 'content' 0.02710.2165 1,959.75783,890.9375
Script end 0.2437  5,850.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00492.0253200.0002
Check MTime0.00150.6059200.0001
Mysql Total
Database connection0.00080.317910.0008
Mysqli_queries0.130653.58391410.0009
Looping result0.00160.66651390.0000
Template Total0.216188.610.2161
Template load0.00100.417710.0010
Template processing0.215088.218410.2150
Override
Cache load0.00070.280210.0007
Sytem overhead
Fetch class attribute can translate value0.00230.926810.0023
XML
Image XML parsing0.00030.103410.0003
General
dbfile0.01154.7255200.0006
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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.0001 secs