Browse Source

Issue #2867852 by Arlina: Check visibility rules of blocks for drupal_region()

8.x-1.x
arlina 8 years ago committed by Chi
parent
commit
2d9a6629f8
  1. 4
      src/TwigExtension.php

4
src/TwigExtension.php

@ -203,6 +203,10 @@ class TwigExtension extends \Twig_Extension {
$build = []; $build = [];
/* @var $blocks \Drupal\block\BlockInterface[] */ /* @var $blocks \Drupal\block\BlockInterface[] */
foreach ($blocks as $id => $block) { 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(); $block_plugin = $block->getPlugin();
if ($block_plugin instanceof TitleBlockPluginInterface) { if ($block_plugin instanceof TitleBlockPluginInterface) {
$request = $this->requestStack->getCurrentRequest(); $request = $this->requestStack->getCurrentRequest();

Loading…
Cancel
Save