diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 42f22fa..d9d2106 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -350,7 +350,7 @@ function _block_get_renderable_region($list = array()) { // skip the help block, since we assume that most users do not need or want // to perform contextual actions on the help block, and the links needlessly // draw attention on it. - if (!in_array($block->get('plugin'), array('system_help_block', 'system_main_block'))) { + if (isset($build[$key]) && !in_array($block->get('plugin'), array('system_help_block', 'system_main_block'))) { $build[$key]['#contextual_links']['block'] = array('admin/structure/block/manage', array($key)); } } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index b746b21..9020087 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -59,6 +59,7 @@ function testBlockVisibility() { // Confirm that an empty block is not displayed. $this->assertNoText('Powered by Drupal', 'Empty block not displayed.'); + $this->assertNoRaw('sidebar-first', 'Empty sidebar-first region is not displayed.'); } /**