Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting loop property of a section throws error in 3.1.28 #161

Closed
dirkkok opened this issue Jan 12, 2016 · 4 comments
Closed

Getting loop property of a section throws error in 3.1.28 #161

dirkkok opened this issue Jan 12, 2016 · 4 comments

Comments

@dirkkok
Copy link

dirkkok commented Jan 12, 2016

In Smarty 3.1.28 the loop property of a section is not available anymore, breaking existing code.

Take for example the piece of code from Example 7.74 in {section} documentation:

{section name=customer loop=$custid}
  {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section}
There are {$smarty.section.customer.loop} customers shown above.

And my PHP code:

$smarty = new PortalSmarty();
$smarty->assign('custid', [0 => 'Customer 1', 1 => 'Customer 2', 2 => 'Customer 3']);
$smarty->display('path/to/file.tpl');

I get the following error:

--> Smarty Compiler: Syntax error in template "/path/to/file.tpl"  on line 6 "There are {$smarty.section.customer.loop} customers shown above." missing or illegal $smarty.section property attribute <-- 

Other properties like index or total do still work.

@uwetews
Copy link
Contributor

uwetews commented Jan 26, 2016

The fix is now in the master branch and will later be included in 3.1.30

@uwetews uwetews closed this as completed Jan 26, 2016
@jpastoor
Copy link

Thanks!

ps. Looks like the IDE / code formatter changed a lot more than just the intended change? Either way thanks for the fix!

@dirkkok
Copy link
Author

dirkkok commented Jan 26, 2016

Nice!

uwetews added a commit that referenced this issue Jan 26, 2016
@uwetews
Copy link
Contributor

uwetews commented Jan 26, 2016

Sorry folks
I did screw things up last night.
There is a new commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants