From c7d138f93ced3456b7e539680b559461ec1b5b38 Mon Sep 17 00:00:00 2001 From: Bruno Ferme Gasparin Date: Wed, 25 Oct 2017 11:32:59 -0200 Subject: [PATCH 1/3] Fixed StackNodeVisitor for latest 1.* twig version --- lib/TwigStack/NodeVisitor/StackNodeVisitor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/TwigStack/NodeVisitor/StackNodeVisitor.php b/lib/TwigStack/NodeVisitor/StackNodeVisitor.php index 7781779..bbfae04 100644 --- a/lib/TwigStack/NodeVisitor/StackNodeVisitor.php +++ b/lib/TwigStack/NodeVisitor/StackNodeVisitor.php @@ -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')) { $body = $node->getNode('body'); $node->setNode('body', new StackBodyNode($body)); } @@ -70,4 +70,4 @@ public function getPriority() { return -10; } -} \ No newline at end of file +} From 5402a2b6a1b15ee1da440277ed1abf2672dffa06 Mon Sep 17 00:00:00 2001 From: Bruno Ferme Gasparin Date: Wed, 25 Oct 2017 11:45:16 -0200 Subject: [PATCH 2/3] Fixed for twig 1.25 --- lib/TwigStack/NodeVisitor/StackNodeVisitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/TwigStack/NodeVisitor/StackNodeVisitor.php b/lib/TwigStack/NodeVisitor/StackNodeVisitor.php index bbfae04..2d3ae4c 100644 --- a/lib/TwigStack/NodeVisitor/StackNodeVisitor.php +++ b/lib/TwigStack/NodeVisitor/StackNodeVisitor.php @@ -54,7 +54,7 @@ public function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) */ private function handleModuleNode(\Twig_Node_Module $node) { - if ($node->hasNode('body') && ! $node->hasNode('parent')) { + if ($node->hasNode('body') && (!$node->hasNode('parent') || null === $node->getNode('parent'))) { $body = $node->getNode('body'); $node->setNode('body', new StackBodyNode($body)); } From 5914315826176ea69490adbc4669910494f09a1f Mon Sep 17 00:00:00 2001 From: Bruno Ferme Gasparin Date: Wed, 1 Nov 2017 17:53:57 -0200 Subject: [PATCH 3/3] Changed the package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ef6204a..d898f87 100644 --- a/composer.json +++ b/composer.json @@ -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"],