reverted: --- b/core/modules/system/system.module +++ a/core/modules/system/system.module @@ -22,7 +22,6 @@ use Drupal\Core\Extension\ModuleHandler; use Drupal\Core\Url; use Drupal\Core\Block\BlockPluginInterface; -use Drupal\Core\Theme\MissingThemeDependencyException; use Drupal\user\UserInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use GuzzleHttp\Exception\RequestException; @@ -524,25 +523,8 @@ $page['#attached']['library'][] = 'system/admin'; } - // Band-aid. - /** @var \Drupal\Core\Theme\ThemeManagerInterface $theme_manager */ - $theme_manager = \Drupal::theme(); - /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ - $theme_handler = \Drupal::service('theme_handler'); - $get_active_theme = function () use ($theme_manager, $theme_handler, &$get_active_theme) { - try { - $active_theme = $theme_manager->getActiveTheme(); - return $active_theme; - } - catch (MissingThemeDependencyException $e) { - $theme_handler->install([$e->theme]); - $themes = $theme_handler->rebuildThemeData(); - return $get_active_theme(); - } - }; - // Attach libraries used by this theme. + $active_theme = \Drupal::theme()->getActiveTheme(); - $active_theme = $get_active_theme(); foreach ($active_theme->getLibraries() as $library) { $page['#attached']['library'][] = $library; }