From 2d9a6629f82ce349acdb9d0e6516b75ae10af74d Mon Sep 17 00:00:00 2001 From: arlina Date: Sun, 30 Apr 2017 06:55:17 +0300 Subject: [PATCH] Issue #2867852 by Arlina: Check visibility rules of blocks for drupal_region() --- src/TwigExtension.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TwigExtension.php b/src/TwigExtension.php index 7cecca3..4b84ce8 100644 --- a/src/TwigExtension.php +++ b/src/TwigExtension.php @@ -203,6 +203,10 @@ class TwigExtension extends \Twig_Extension { $build = []; /* @var $blocks \Drupal\block\BlockInterface[] */ foreach ($blocks as $id => $block) { + // Should the block be displayed? (follow rules from block layout page). + if (!$block->access('view')) { + continue; + } $block_plugin = $block->getPlugin(); if ($block_plugin instanceof TitleBlockPluginInterface) { $request = $this->requestStack->getCurrentRequest();