diff --git a/core/modules/block/src/BlockRepository.php b/core/modules/block/src/BlockRepository.php index fff1fb8..61d364e 100644 --- a/core/modules/block/src/BlockRepository.php +++ b/core/modules/block/src/BlockRepository.php @@ -47,22 +47,12 @@ public function __construct(EntityManagerInterface $entity_manager, ThemeManager } /** - * Returns the human-readable list of regions keyed by machine name. - * - * @return array - * An array of human-readable region names keyed by machine name. - */ - protected function getRegionNames() { - return system_region_list($this->getTheme()); - } - - /** * Returns the list of regions keyed by machine name. * * @return array * An array of region machine names keyed by machine name. */ - protected function getRegions() { + protected function getRegionNames() { return system_region_list($this->getTheme(), REGIONS_ALL, FALSE); } @@ -81,7 +71,8 @@ protected function getTheme() { */ public function getVisibleBlocksPerRegion(array $contexts) { // Build an array of the region names in the right order. - $empty = array_fill_keys($this->getRegions(), array()); + $empty = array_fill_keys($this->getRegionNames(), array()); + $full = array(); foreach ($this->blockStorage->loadByProperties(array('theme' => $this->getTheme())) as $block_id => $block) { /** @var \Drupal\block\BlockInterface $block */ diff --git a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php index f589e82..1cd639b 100644 --- a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php +++ b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php @@ -69,9 +69,9 @@ protected function setUp() { $this->blockRepository->expects($this->once()) ->method('getRegionNames') ->willReturn([ - 'top' => 'Top', - 'center' => 'Center', - 'bottom' => 'Bottom', + 'top' => 'top', + 'center' => 'center', + 'bottom' => 'bottom', ]); }