diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -5,7 +5,6 @@ * Install, update and uninstall functions for the system module. */ -use Drupal\block\Entity\Block; use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Environment; use Drupal\Component\Utility\SafeMarkup; @@ -1132,6 +1131,7 @@ /** @var \Drupal\Core\Extension\Extension $theme */ foreach ($theme_handler->listInfo() as $theme) { $theme_name = $theme->getName(); + $block_storage = \Drupal::entityManager()->getStorage('block'); switch ($theme_name) { case 'bartik': if (!$config_storage->exists('block.block.bartik_local_actions')) { @@ -1140,7 +1140,7 @@ 'theme' => 'bartik', 'weight' => -20, ] + $local_actions_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } if (!$config_storage->exists('block.block.bartik_tabs')) { $values = [ @@ -1148,7 +1148,7 @@ 'theme' => 'bartik', 'weight' => -30, ] + $tabs_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } break; @@ -1159,7 +1159,7 @@ 'theme' => 'seven', 'weight' => -10, ] + $local_actions_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } if (!$config_storage->exists('block.block.seven_primary_tabs')) { $values = [ @@ -1172,7 +1172,7 @@ 'secondary' => FALSE, ], ] + $tabs_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } if (!$config_storage->exists('block.block.seven_secondary_tabs')) { @@ -1186,7 +1186,7 @@ 'secondary' => TRUE, ], ] + $tabs_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } break; @@ -1196,14 +1196,14 @@ 'id' => 'stark_local_actions', 'theme' => 'stark', ] + $local_actions_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } if (!$config_storage->exists('block.block.stark_tabs')) { $values = [ 'id' => 'stark_tabs', 'theme' => 'stark', ] + $tabs_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } break; @@ -1219,7 +1219,7 @@ 'theme' => $theme_name, 'weight' => -10, ] + $local_actions_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } if (!$config_storage->exists(sprintf('block.block.%s_tabs', $theme_name))) { $values = [ @@ -1227,7 +1227,7 @@ 'theme' => $theme_name, 'weight' => -20, ] + $tabs_default_settings; - \Drupal::entityManager()->getStorage('block')->create($values)->save(); + $block_storage->create($values)->save(); } break; }