diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index f057f0a..69d7e66 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -52,8 +52,6 @@ public function getConfig() { // If the plugin configuration is not already set, initialize it with the // default settings for the block plugin. $this->configuration = $this->blockSettings(); - // Ensure that the default cache mode is set. - $this->configuration += array('cache' => DRUPAL_NO_CACHE); // @todo This loads the default subject. Is this the right place to do so? $definition = $this->getDefinition(); @@ -61,6 +59,8 @@ public function getConfig() { $this->configuration += array('subject' => $definition['subject']); } } + // Ensure that the default cache mode is set. + $this->configuration += array('cache' => DRUPAL_NO_CACHE); return $this->configuration; } 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 7996c93..415d43b 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 @@ -149,12 +149,11 @@ public function getPlugin() { */ public function get($property_name, $langcode = NULL) { // The theme is stored in the entity ID. - if ($property_name == 'theme') { - list($theme) = explode('.', $this->id()); - return $theme; + $value = parent::get($property_name, $langcode); + if ($property_name == 'theme' && !$value) { + list($value) = explode('.', $this->id()); } - - return parent::get($property_name, $langcode); + return $value; } /**