diff --git a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php index d245160..895633d 100644 --- a/core/lib/Drupal/Core/Template/TwigNodeVisitor.php +++ b/core/lib/Drupal/Core/Template/TwigNodeVisitor.php @@ -41,9 +41,9 @@ function enterNode(\Twig_NodeInterface $node, \Twig_Environment $env) { // Optimization: Do not support nested values. $validPath = count($this->isAttributePath) > 0 ? array_sum($this->isAttributePath) === 0 : TRUE; -// if ($this->isReference && $validPath && !($node instanceof \Twig_Node_Expression_GetAttr || $node instanceof \Twig_Node_Expression_Name || $node instanceof \Twig_Node_Expression_Constant || $node instanceof \Twig_Node_Expression_Array)) { -// $this->isReference = FALSE; -// } + if ($this->isReference && $validPath && !($node instanceof \Twig_Node_Expression_GetAttr || $node instanceof \Twig_Node_Expression_Name || $node instanceof \Twig_Node_Expression_Constant || $node instanceof \Twig_Node_Expression_Array)) { + $this->isReference = FALSE; + } if ($node instanceof \Twig_Node_Expression_Function) { $name = $node->getAttribute('name'); @@ -121,10 +121,10 @@ function leaveNode(\Twig_NodeInterface $node, \Twig_Environment $env) { } } -// if ($node instanceof \Twig_Function_Function) { -// // Do something! -// $this->isReference = FALSE; -// } + if ($node instanceof \Twig_Function_Function) { + // Do something! + $this->isReference = FALSE; + } if ($node->hasAttribute('expression_path')) { array_shift($this->isAttributePath);