diff --git a/core/modules/settings_tray/settings_tray.module b/core/modules/settings_tray/settings_tray.module index 64e6df6737..9a1c763efb 100644 --- a/core/modules/settings_tray/settings_tray.module +++ b/core/modules/settings_tray/settings_tray.module @@ -11,7 +11,6 @@ use Drupal\settings_tray\Block\BlockEntityOffCanvasForm; use Drupal\settings_tray\Form\SystemBrandingOffCanvasForm; use Drupal\settings_tray\Form\SystemMenuOffCanvasForm; -use Drupal\block\BlockInterface; use Drupal\block\Entity\Block; /** @@ -56,21 +55,6 @@ function settings_tray_contextual_links_view_alter(&$element, $items) { } } -/** - * Checks if a block has overrides. - * - * @param \Drupal\block\BlockInterface $block - * The block to check for overrides. - * - * @return bool - * TRUE if the block has overrides otherwise FALSE. - * - * @internal - */ -function _settings_tray_has_block_overrides(BlockInterface $block) { - return \Drupal::config($block->getEntityType()->getConfigPrefix() . '.' . $block->id())->hasOverrides(); -} - /** * Implements hook_block_view_alter(). */ @@ -219,8 +203,10 @@ function settings_tray_css_alter(&$css, AttachedAssetsInterface $assets) { */ function settings_tray_contextual_links_alter(array &$links, $group, array $route_parameters) { if (isset($links['settings_tray.block_configure']['route_parameters']['block'])) { + /** @var \Drupal\block\BlockInterface $block */ $block = Block::load($links['settings_tray.block_configure']['route_parameters']['block']); - if (_settings_tray_has_block_overrides($block)) { + $block_config = \Drupal::config($block->getEntityType()->getConfigPrefix() . '.' . $block->id()); + if ($block_config->hasOverrides()) { $links['settings_tray.block_configure']['route_name'] = 'settings_tray.overridden_block_notice'; } }