From 32e89c93a76bc8f5c7e35d95447a47c331c8164d Mon Sep 17 00:00:00 2001 From: eiriksm Date: Tue, 16 Apr 2019 16:57:41 +0500 Subject: [PATCH] Issue #3045120 by eiriksm: drupal_block does not use the plugin cache metadata --- src/TwigExtension.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/TwigExtension.php b/src/TwigExtension.php index 66bc69f..b79a508 100644 --- a/src/TwigExtension.php +++ b/src/TwigExtension.php @@ -129,6 +129,11 @@ class TwigExtension extends \Twig_Extension { '#base_plugin_id' => $block_plugin->getBaseId(), '#derivative_plugin_id' => $block_plugin->getDerivativeId(), 'content' => $content, + '#cache' => [ + 'contexts' => $block_plugin->getCacheContexts(), + 'tags' => $block_plugin->getCacheTags(), + 'max-age' => $block_plugin->getCacheMaxAge(), + ], ]; } else {