diff --git a/core/lib/Drupal/Core/Template/TwigTemplate.php b/core/lib/Drupal/Core/Template/TwigTemplate.php index 7d7eeca..ba71eeb 100644 --- a/core/lib/Drupal/Core/Template/TwigTemplate.php +++ b/core/lib/Drupal/Core/Template/TwigTemplate.php @@ -51,6 +51,13 @@ return NULL; } + // Turn off references for looped items + // @todo hide, show is not supported for them for now. + // @see http://drupal.org/node/1867090 Nested loops behaving strange. + if (isset($context['loop'])) { + return $context[$item]; + } + // The first test also finds empty / null render arrays if (!$context[$item] || isset($this->is_no_reference[$item])) { return $context[$item];