Re: [SMARTY] Re: object calls fail after upgrade to 2.6.4
[email protected] (Hans Jürgen von Lengerke)
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <[email protected]> |
Hi Monte,
sorry, I was really busy today so I couldn't answer you until now. All
the object parameter issues seem to be resolved now, but I have now
found several bugs related to math:
{foreach name=loop from=$items item=i}
{$smarty.foreach.loop.iteration+$obj->arr.two}
{/foreach}
the above fails to parse with
PHP Fatal error: Smarty error: [in assign_obj.tpl line 10]: syntax
error: $smarty.foreach.loop is an invalid reference
(Smarty_Compiler.class.php, line 1962) in
/home/entw/hj/ext-cvs/smarty_HEAD/libs/Smarty.class.php on line 1084
These fail too:
{$smarty.foreach.loop.iteration+$obj->arr()}
{$smarty.foreach.loop.iteration+$obj->num}
{$obj->meth()+$obj->meth()}
{$obj->meth()+$obj->val}
{$obj->meth()+$foo}
{$obj->meth()+2}
This one is OK:
{$smarty.foreach.loop.iteration+2}
And these are parsed wrongly:
{$obj->val+$foo}
{$obj->val*$foo}
{$obj->val+$obj->val}
{$obj->val+$obj->meth()}
{$foo+$obj->meth()}
{$foo.bar+$obj->meth()}
They result in:
<?php echo $this->_tpl_vars['obj']->val+$foo; ?>
<?php echo $this->_tpl_vars['obj']->val*$foo; ?>
<?php echo $this->_tpl_vars['obj']->val+$obj->val; ?>
<?php echo $this->_tpl_vars['obj']->val+$obj->meth(); ?>
<?php echo $this->_tpl_vars['foo']+$obj->meth(); ?>
<?php echo $this->_tpl_vars['foo']['bar']+$obj->meth(); ?>
Do you have a bug tracking system somewhere? I couldn't find anything
about it on the web page, but I didn't look very hard.
I will provide unit test cases for all of the above later.
Hans