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.