diff -u b/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php --- b/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -15,6 +15,7 @@ use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Menu\MenuTreeParameters; use Drupal\Core\Theme\ThemeAccessCheck; +use Drupal\Core\Cache; use Drupal\Core\Url; use Drupal\system\SystemManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -67,6 +68,13 @@ protected $menuLinkTree; /** + * The bootstrap cache service. + * + * @var \Drupal\Core\Cache\CacheBackendInterface + */ + protected $bootstrapCache; + + /** * Constructs a new SystemController. * * @param \Drupal\system\SystemManager $systemManager @@ -81,14 +89,17 @@ * The theme handler. * @param \Drupal\Core\Menu\MenuLinkTreeInterface * The menu link tree service. + * @parm \Drupal\Core\Cache\CacheBackendInterface + * The bootstrap cache service. */ - public function __construct(SystemManager $systemManager, QueryFactory $queryFactory, ThemeAccessCheck $theme_access, FormBuilderInterface $form_builder, ThemeHandlerInterface $theme_handler, MenuLinkTreeInterface $menu_link_tree) { + public function __construct(SystemManager $systemManager, QueryFactory $queryFactory, ThemeAccessCheck $theme_access, FormBuilderInterface $form_builder, ThemeHandlerInterface $theme_handler, MenuLinkTreeInterface $menu_link_tree, CacheBackendInterface $bootstrap_cache) { $this->systemManager = $systemManager; $this->queryFactory = $queryFactory; $this->themeAccess = $theme_access; $this->formBuilder = $form_builder; $this->themeHandler = $theme_handler; $this->menuLinkTree = $menu_link_tree; + $this->bootstrapCache = $bootstrap_cache; } /** @@ -102,6 +113,7 @@ $container->get('form_builder'), $container->get('theme_handler'), $container->get('menu.link_tree') + $container->get('cache.bootstrap') ); } @@ -187,7 +199,7 @@ */ public function themesPage() { // Clean up the bootstrap "missing files" cache when listing themes. - \Drupal::cache('bootstrap')->delete('drupal_get_filename:missing'); + $this->bootstrapCache->delete('drupal_get_filename:missing'); drupal_static_reset('drupal_get_filename:missing'); $config = $this->config('system.theme'); diff -u b/core/modules/system/src/Tests/Bootstrap/GetFilenameUnitTest.php b/core/modules/system/src/Tests/Bootstrap/GetFilenameUnitTest.php --- b/core/modules/system/src/Tests/Bootstrap/GetFilenameUnitTest.php +++ b/core/modules/system/src/Tests/Bootstrap/GetFilenameUnitTest.php @@ -80,7 +80,7 @@ return; } throw new ErrorException($message, 0, $severity, $file, $line); - } + }); // Searching for an item that does not exist returns NULL. $this->assertNull(drupal_get_filename('module', $non_existing_module), 'Searching for an item that does not exist returns NULL.'); // Restore the original error handler. diff -u b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php --- b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php +++ b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php @@ -81,7 +81,7 @@ return; } throw new ErrorException($message, 0, $severity, $file, $line); - } + }); $build['#attached']['library'][] = 'unknown/unknown'; $assets = AttachedAssets::createFromRenderArray($build);