core/modules/system/src/Plugin/Block/SystemPageActionsBlock.php | 8 +++++--- core/modules/system/src/Plugin/Block/SystemPageMessagesBlock.php | 5 +++-- core/modules/system/src/Plugin/Block/SystemPageTabsBlock.php | 8 +++++--- core/modules/system/src/Plugin/Block/SystemPageTitleBlock.php | 6 +++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/core/modules/system/src/Plugin/Block/SystemPageActionsBlock.php b/core/modules/system/src/Plugin/Block/SystemPageActionsBlock.php index 3c234a1..813da5a 100644 --- a/core/modules/system/src/Plugin/Block/SystemPageActionsBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemPageActionsBlock.php @@ -115,9 +115,9 @@ public function build() { public function buildConfigurationForm(array $form, array &$form_state) { $form = parent::buildConfigurationForm($form, $form_state); - // The page actions block is never cacheable, because it may be dynamic. + // The "Page actions" block is never cacheable, due to access checking. $form['cache']['#disabled'] = TRUE; - $form['cache']['#description'] = $this->t('This block is never cacheable, it is not configurable.'); + $form['cache']['#description'] = $this->t('This block is never cacheable because access checking is needed, it is not configurable.'); $form['cache']['max_age']['#value'] = 0; return $form; @@ -127,7 +127,9 @@ public function buildConfigurationForm(array $form, array &$form_state) { * {@inheritdoc} */ public function isCacheable() { - // The page actions block is never cacheable, because it may be dynamic. + // The "Page Actions" block is never cacheable, because its contents depends + // on access checks, which are currently uncacheable. + // @todo Make cacheable once https://drupal.org/node/2287071 lands. return FALSE; } diff --git a/core/modules/system/src/Plugin/Block/SystemPageMessagesBlock.php b/core/modules/system/src/Plugin/Block/SystemPageMessagesBlock.php index 202f203..ad9e237 100644 --- a/core/modules/system/src/Plugin/Block/SystemPageMessagesBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemPageMessagesBlock.php @@ -114,7 +114,7 @@ public function getMessages($element) { public function buildConfigurationForm(array $form, array &$form_state) { $form = parent::buildConfigurationForm($form, $form_state); - // The page messages block is never cacheable, because it may be dynamic. + // @see ::isCacheable() $form['cache']['#disabled'] = TRUE; $form['cache']['#description'] = $this->t('This block is never cacheable, it is not configurable.'); $form['cache']['max_age']['#value'] = 0; @@ -126,7 +126,8 @@ public function buildConfigurationForm(array $form, array &$form_state) { * {@inheritdoc} */ public function isCacheable() { - // The page messages block is never cacheable, because it may be dynamic. + // The page messages block is never cacheable, because its contents are + // session-specific and caching is useless. return FALSE; } diff --git a/core/modules/system/src/Plugin/Block/SystemPageTabsBlock.php b/core/modules/system/src/Plugin/Block/SystemPageTabsBlock.php index 67e737b..bd9ac2c 100644 --- a/core/modules/system/src/Plugin/Block/SystemPageTabsBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemPageTabsBlock.php @@ -81,9 +81,9 @@ public function build() { public function buildConfigurationForm(array $form, array &$form_state) { $form = parent::buildConfigurationForm($form, $form_state); - // The page tabs block is never cacheable, because it may be dynamic. + // The "Page tabs" block is never cacheable, due to access checking. $form['cache']['#disabled'] = TRUE; - $form['cache']['#description'] = $this->t('This block is never cacheable, it is not configurable.'); + $form['cache']['#description'] = $this->t('This block is never cacheable because access checking is needed, it is not configurable.'); $form['cache']['max_age']['#value'] = 0; return $form; @@ -93,7 +93,9 @@ public function buildConfigurationForm(array $form, array &$form_state) { * {@inheritdoc} */ public function isCacheable() { - // The page tabs block is never cacheable, because it may be dynamic. + // The "Page Tabs" block is never cacheable, because its contents depends + // on access checks, which are currently uncacheable. + // @todo Make cacheable once https://drupal.org/node/2287071 lands. return FALSE; } diff --git a/core/modules/system/src/Plugin/Block/SystemPageTitleBlock.php b/core/modules/system/src/Plugin/Block/SystemPageTitleBlock.php index a198c0c..b3b6c86 100644 --- a/core/modules/system/src/Plugin/Block/SystemPageTitleBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemPageTitleBlock.php @@ -116,9 +116,9 @@ public function build() { public function buildConfigurationForm(array $form, array &$form_state) { $form = parent::buildConfigurationForm($form, $form_state); - // The page title block is never cacheable, because it may be dynamic. + // The 'Page title' block is never cacheable, because it may be dynamic. $form['cache']['#disabled'] = TRUE; - $form['cache']['#description'] = $this->t('This block is never cacheable, it is not configurable.'); + $form['cache']['#description'] = t('This block is never cacheable, it is not configurable.'); $form['cache']['max_age']['#value'] = 0; return $form; @@ -128,7 +128,7 @@ public function buildConfigurationForm(array $form, array &$form_state) { * {@inheritdoc} */ public function isCacheable() { - // The page title block is never cacheable, because it may be dynamic. + // The 'Page title' block is never cacheable, because it may be dynamic. return FALSE; }