reverted: --- b/core/lib/Drupal/Core/Template/TwigExtension.php +++ a/core/lib/Drupal/Core/Template/TwigExtension.php @@ -4,9 +4,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Render\MarkupInterface; -use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Datetime\DateFormatterInterface; -use Drupal\Core\Render\AttachmentsInterface; use Drupal\Core\Render\RenderableInterface; use Drupal\Core\Render\RendererInterface; use Drupal\Core\Routing\UrlGeneratorInterface; @@ -412,8 +410,6 @@ return NULL; } - $this->bubbleArgMetadata($arg); - // Keep Twig_Markup objects intact to support autoescaping. if ($autoescape && ($arg instanceof \Twig_Markup || $arg instanceof MarkupInterface)) { return $arg; @@ -466,24 +462,6 @@ return $this->renderer->render($arg); } - protected function bubbleArgMetadata($arg) { - if ($arg instanceof CacheableDependencyInterface || $arg instanceof AttachmentsInterface) { - $arg_bubbleable = []; - if ($arg instanceof CacheableDependencyInterface) { - $arg_bubbleable['#cache']['contexts'] = $arg->getCacheContexts(); - $arg_bubbleable['#cache']['tags'] = $arg->getCacheTags(); - $arg_bubbleable['#cache']['max-age'] = $arg->getCacheMaxAge(); - } - if ($arg instanceof AttachmentsInterface) { - $arg_bubbleable['#attached'] = $arg->getAttachments(); - } - if ($arg_bubbleable) { - // @todo Inject the Renderer in https://www.drupal.org/node/2529438. - drupal_render($arg_bubbleable); - } - } - } - /** * Wrapper around render() for twig printed output. * @@ -526,7 +504,6 @@ } if (is_object($arg)) { - $this->bubbleArgMetadata($arg); if ($arg instanceof RenderableInterface) { $arg = $arg->toRenderable(); }