diff --git a/core/lib/Drupal/Core/Block/BlockBase.php b/core/lib/Drupal/Core/Block/BlockBase.php index 0cbfd11..ef127e9 100644 --- a/core/lib/Drupal/Core/Block/BlockBase.php +++ b/core/lib/Drupal/Core/Block/BlockBase.php @@ -274,6 +274,16 @@ public function getMachineNameSuggestion() { } /** + * {@inheritdoc} + */ + public function getCacheMaxAge() { + $max_age = parent::getCacheMaxAge(); + // @todo Configurability of this will be removed in + // https://www.drupal.org/node/2458763. + return Cache::mergeMaxAges($max_age, (int) $this->configuration['cache']['max_age']); + } + + /** * Wraps the transliteration service. * * @return \Drupal\Component\Transliteration\TransliterationInterface diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php index 4eb1b27..51a39d7 100644 --- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php +++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php @@ -129,9 +129,7 @@ public function getCacheTags() { * {@inheritdoc} */ public function getCacheMaxAge() { - // @todo Configurability of this will be removed in - // https://www.drupal.org/node/2458763. - $max_age = (int)$this->configuration['cache']['max_age']; + $max_age = Cache::PERMANENT; // Applied contexts can affect the cache max age when this plugin is // involved in caching, collect and return them.