diff --git a/core/modules/block/lib/Drupal/block/BlockRenderController.php b/core/modules/block/lib/Drupal/block/BlockRenderController.php index 82134c6..4ecb2a1 100644 --- a/core/modules/block/lib/Drupal/block/BlockRenderController.php +++ b/core/modules/block/lib/Drupal/block/BlockRenderController.php @@ -82,18 +82,17 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N public function viewMultiple(array $entities = array(), $view_mode = 'full', $langcode = NULL) { $build = array(); foreach ($entities as $entity_id => $entity) { - $block = $entity->getPlugin()->blockBuild(); + $build[$entity_id] = $entity->getPlugin()->blockBuild(); // Allow blocks to be empty, do not add in the defaults. - if (!empty($block)) { - $block = $this->getBuildDefaults($entity, $view_mode, $langcode) + $block; + if (!empty($build[$entity_id])) { + $build[$entity_id] = $this->getBuildDefaults($entity, $view_mode, $langcode) + $build[$entity_id]; } // All blocks, even when empty, should be available for altering. $id = str_replace(':', '__', $entity->get('plugin')); list(, $name) = $entity->id(); - drupal_alter(array('block_view', "block_view_$id", "block_view_$name"), $block, $entity); + drupal_alter(array('block_view', "block_view_$id", "block_view_$name"), $build[$entity_id], $entity); - $build[$entity_id] = $block; } return $build; } diff --git a/core/modules/block/lib/Drupal/block/BlockStorageController.php b/core/modules/block/lib/Drupal/block/BlockStorageController.php index 02374ff..6fb5ec5 100644 --- a/core/modules/block/lib/Drupal/block/BlockStorageController.php +++ b/core/modules/block/lib/Drupal/block/BlockStorageController.php @@ -51,7 +51,7 @@ public function loadByProperties(array $values = array()) { $blocks = $this->load(); foreach ($values as $key => $value) { $blocks = array_filter($blocks, function($block) use ($key, $value) { - return $value == $block->get($key); + return $value === $block->get($key); }); } return $blocks; diff --git a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php index 7f27640..e8ccc63 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php @@ -107,7 +107,7 @@ class Block extends ConfigEntityBase { protected $theme; /** - * The module owning this block. + * The module owning this plugin. * * @var string */ diff --git a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php index b7186b0..181d32c 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php +++ b/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php @@ -12,7 +12,6 @@ use Drupal\Core\Plugin\Discovery\AlterDecorator; use Drupal\Core\Plugin\Discovery\CacheDecorator; use Drupal\Component\Plugin\Factory\DefaultFactory; -use Drupal\Core\Plugin\Mapper\ConfigMapper; /** * Manages discovery and instantiation of block plugins. @@ -32,7 +31,6 @@ public function __construct() { $this->discovery = new AlterDecorator($this->discovery, 'block'); $this->discovery = new CacheDecorator($this->discovery, 'block_plugins:' . language(LANGUAGE_TYPE_INTERFACE)->langcode, 'cache_block'); $this->factory = new DefaultFactory($this); - $this->mapper = new ConfigMapper($this); } }