diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 038cdd7..7790877 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1093,14 +1093,12 @@ function system_schema() { */ /** - * Place local actions and tasks blocks. + * Place local actions and tasks blocks in every theme. */ function system_update_8001() { - /** @var \Drupal\Core\Extension\ModuleHandler $module_handler */ - $module_handler = \Drupal::service('module_handler'); // Nothing to do if block module is not installed. - if (!$module_handler->moduleExists('block')) { - return \Drupal::translation()->translate('Block module is not enabled so local actions and tasks which have been converted to blocks, are not visible anymore.'); + if (!\Drupal::moduleHandler()->moduleExists('block')) { + return t('Block module is not enabled so local actions and tasks which have been converted to blocks, are not visible anymore.'); } /** @var \Drupal\Core\Extension\ThemeHandler $theme_handler */ $theme_handler = \Drupal::service('theme_handler'); @@ -1131,6 +1129,7 @@ function system_update_8001() { 'max_age' => 0, ], ]; + /** @var \Drupal\Core\Extension\Extension $theme */ foreach ($theme_handler->listInfo() as $theme) { $theme_name = $theme->getName(); switch ($theme_name) { @@ -1217,7 +1216,7 @@ function system_update_8001() { if (!$config_storage->exists(sprintf('block.block.%s_local_actions', $theme_name))) { $values = [ 'id' => sprintf('%s_local_actions', $theme_name), - 'theme' => $theme->getName(), + 'theme' => $theme_name, 'weight' => -10, ] + $local_actions_default_settings; Block::create($values)->save(); @@ -1225,7 +1224,7 @@ function system_update_8001() { if (!$config_storage->exists(sprintf('block.block.%s_tabs', $theme_name))) { $values = [ 'id' => sprintf('%s_tabs', $theme_name), - 'theme' => $theme->getName(), + 'theme' => $theme_name, 'weight' => -20, ] + $tabs_default_settings; Block::create($values)->save(); @@ -1235,7 +1234,7 @@ function system_update_8001() { } if ($custom_themes_installed) { - $message = \Drupal::translation()->translate('Because your site has custom theme(s) installed, we had to set local actions and tasks blocks into the content region. Please manually review the block configurations and remove the removed variables from your templates.'); + $message = t('Because your site has custom theme(s) installed, we had to set local actions and tasks blocks into the content region. Please manually review the block configurations and remove the removed variables from your templates.'); } return $message;