diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 8128ce5..febb1bf 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -326,6 +326,7 @@ function _block_get_renderable_region($list = array()) { else { $key_components = explode('.', $key); $id = array_pop($key_components); + // @todo http://drupal.org/node/1942286 $build[$key] = array( '#entity' => $block, '#block' => (object) $block->getPlugin()->getConfig(), @@ -536,6 +537,7 @@ function block_rebuild() { function template_preprocess_block(&$variables) { $block_counter = &drupal_static(__FUNCTION__, array()); + // @todo http://drupal.org/node/1942286 $variables['block'] = (object) $variables['elements']['#block']; // All blocks get an independent counter for each region. diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 7351e00..9f83308 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -479,19 +479,15 @@ public function build() { $build = array(); $content = array(); if ($content = $this->blockBuild()) { + // @todo http://drupal.org/node/1942286 $build = array( '#block' => (object) $this->getConfig(), '#theme_wrappers' => array('block'), - '#block_config' => array( - 'id' => $this->configuration['plugin'], - 'region' => $this->configuration['region'], - 'module' => $this->configuration['module'], - 'label' => check_plain($this->configuration['label']), - ), ); // The label is the only string we actually render, so we need to handle // it specially. - // @Todo: Give the implications of this line further thought in #1941244. + // @todo: Give the implications of this line further thought in + // http://drupal.org/node/1941244. $build['#block']->label = check_plain($this->configuration['label']); } $build['content'] = $content; @@ -510,6 +506,6 @@ public function build() { * * @see \Drupal\block\BlockRenderController */ - abstract public function blockBuild(); + abstract protected function blockBuild(); } 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 15ce633..009c1a6 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 @@ -200,6 +200,10 @@ public function get($property_name, $langcode = NULL) { * the entity within the settings property. Setting of the settings property * directly is supported, but all set() calls to the settings property are * additive and will not remove settings values. + * + * @todo The basic functionality of this cannot change. The plugin + * configuration and entity values must always be up to date, but we should + * revisit whether this can be simplified. http://drupal.org/node/1942262 */ public function set($property_name, $value) { if (!in_array($property_name, $this->exportProperties()) && $property_name != 'settings') { @@ -267,6 +271,8 @@ public function getExportProperties() { * Implements \Drupal\Core\Entity\EntityInterface::save(). */ public function save() { + // Get any key value pairs in the plugin configuration that are not in the + // entity's properties and add them to the entity's settings property. $this->settings = array_diff_key($this->getPlugin()->getConfig(), $this->getExportProperties()); return parent::save(); } diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php index b11363d..10ad233 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTemplateSuggestionsUnitTest.php @@ -44,6 +44,7 @@ function testBlockThemeHookSuggestions() { )); $variables = array(); + // @todo http://drupal.org/node/1942286 $variables['elements']['#block'] = (object) $block->getPlugin()->getConfig(); $variables['elements']['#children'] = ''; // Test adding a class to the block content.