Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "aygon/twig-stack",
"name": "bfgasparin/twig-stack",
"type": "library",
"description": "Twig extension which adds the possibility to push content to a stack which can be output anywhere in the template",
"keywords": ["templating"],
Expand Down
4 changes: 2 additions & 2 deletions lib/TwigStack/NodeVisitor/StackNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env)
*/
private function handleModuleNode(\Twig_Node_Module $node)
{
if ($node->hasNode('body') && null === $node->getNode('parent')) {
if ($node->hasNode('body') && (!$node->hasNode('parent') || null === $node->getNode('parent'))) {
$body = $node->getNode('body');
$node->setNode('body', new StackBodyNode($body));
}
Expand All @@ -70,4 +70,4 @@ public function getPriority()
{
return -10;
}
}
}