Hi all,
I have a weird problem that raises with Smarty 3.1.15 (included) upwards to dev-trunk with nested templates. Let me explain:
I want to render a multi-level menu and for that I have an array of 'MenuElement' objects, each object can have multiple 'MenuElement' objects as childs inside the MenuElement->submenu property. And I've been rendering them as a nested template.
I render the menu by passing the $menu variable, which contains an array with some MenuElement objects, to the next template:
# menus/new.tpl
{if isset($menu) && is_array($menu->items) && count($menu->items) > 0}
{foreach from=$menu->items item=menuItem}
{include file="menus/partials/_menu_item.tpl" menuItem=$menuItem}
{/foreach}
{/if}
as you can see the previous template iterates over all the array elements and includes an external file which contains the next:
# menus/partials/_menu_item.tpl file contents
<li class="menuItem" id="item_{$menuItem->pk_item}">
<div>
<span class="type">
Menu element
</span>
<span class="menu-title">
{$menuItem->title}
</span>
</div>
{if count($menuItem->submenu) > 0}
<ol>
{foreach $menuItem->submenu as $subMenuItem}
{include file="menus/partials/_menu_item.tpl" menuItem=$subMenuItem}
{/foreach}
</ol>
{/if}
</li>
As you can see if a particular menu element has children in its ->submenu property it will include the same file to reiterate over the child.
So, here is the thing... Before 3.1.15 this approach have been working without any problem. But with newer versions this has stopped to work by raising a fatal error with "Fatal error: Maximum function nesting level of '100' reached"
Can you test it if you can reproduce it?