Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
SVN revision 4821 has compile bug

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Soren
Smarty n00b


Joined: 23 Dec 2011
Posts: 4

PostPosted: Tue Mar 18, 2014 12:50 pm    Post subject: SVN revision 4821 has compile bug Reply with quote

There is template (fragment):

Code:

   {if $form_errors|default:[]}
      <div class="errors">
         <ul>
            {foreach $form_errors as $error_key => $error}
               <li>{$error}</li>
            {/foreach}
         </ul>
      </div>
   {/if}


In SVN revision 4820 it compiles into:
Code:

   <?php if ((($tmp = @$_smarty_tpl->tpl_vars['form_errors']->value)===null||$tmp==='' ? array() : $tmp)) {?>
      <div class="errors">
         <ul>
            <?php  $_smarty_tpl->tpl_vars['error'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['error']->_loop = false;
 $_smarty_tpl->tpl_vars['error_key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['form_errors']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['error']->key => $_smarty_tpl->tpl_vars['error']->value) {
$_smarty_tpl->tpl_vars['error']->_loop = true;
 $_smarty_tpl->tpl_vars['error_key']->value = $_smarty_tpl->tpl_vars['error']->key;
?>
               <li><?php echo $_smarty_tpl->tpl_vars['error']->value;?>
 </li>
            <?php } ?>
         </ul>
      </div>
   <?php }?>


Since revision 4821 it compiles into:
Code:

   {if $form_errors|default:[]}
      <div class="errors">
         <ul>
            {foreach $form_errors as $error_key => $error}
               <li><?php echo $_smarty_tpl->tpl_vars['error']->value;?>
 </li>
            {/foreach}
         </ul>
      </div>
   {/if}
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4636
Location: Hamburg / Germany

PostPosted: Thu Mar 20, 2014 10:14 pm    Post subject: Reply with quote

This is now fixed in the SVN trunk
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP