diff --git a/core/modules/block/src/Controller/BlockController.php b/core/modules/block/src/Controller/BlockController.php index 7f75d0b..effa842 100644 --- a/core/modules/block/src/Controller/BlockController.php +++ b/core/modules/block/src/Controller/BlockController.php @@ -54,7 +54,6 @@ public static function create(ContainerInterface $container) { * A #type 'page' render array containing the block region demo. */ public function demo($theme) { - // Deny access if the theme is not installed or not found. if (!$this->themeHandler->hasUi($theme)) { throw new NotFoundHttpException(); } diff --git a/core/modules/block/src/Controller/BlockListController.php b/core/modules/block/src/Controller/BlockListController.php index b0c5e3f..6185c90 100644 --- a/core/modules/block/src/Controller/BlockListController.php +++ b/core/modules/block/src/Controller/BlockListController.php @@ -57,7 +57,6 @@ public static function create(ContainerInterface $container) { */ public function listing($theme = NULL, Request $request = NULL) { $theme = $theme ?: $this->config('system.theme')->get('default'); - // Deny access if the theme is not installed or not found. if (!$this->themeHandler->hasUi($theme)) { throw new NotFoundHttpException(); } diff --git a/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php index 5828189..4d0f03a 100644 --- a/core/modules/block/src/Tests/BlockUiTest.php +++ b/core/modules/block/src/Tests/BlockUiTest.php @@ -145,12 +145,11 @@ function testBlockAdminUiPage() { // theme and place the local tasks block. $this->assertTrue(\Drupal::service('theme_handler')->themeExists('classy'), 'The classy base theme is enabled'); $this->drupalPlaceBlock('local_tasks_block', ['region' => 'header']); - \Drupal::service('theme_installer')->install(['stable']); - \Drupal::service('theme_installer')->install(['test_theme']); + \Drupal::service('theme_installer')->install(['stable', 'stark']); $this->drupalGet('admin/structure/block'); $theme_handler = \Drupal::service('theme_handler'); $this->assertLink($theme_handler->getName('classy')); - $this->assertLink($theme_handler->getName('test_theme')); + $this->assertLink($theme_handler->getName('stark')); $this->assertNoLink($theme_handler->getName('stable')); $this->drupalGet('admin/structure/block/list/stable'); diff --git a/core/modules/system/src/Controller/ThemeController.php b/core/modules/system/src/Controller/ThemeController.php index 5f56052..d54cd91 100644 --- a/core/modules/system/src/Controller/ThemeController.php +++ b/core/modules/system/src/Controller/ThemeController.php @@ -30,26 +30,16 @@ class ThemeController extends ControllerBase { protected $themeHandler; /** - * The route builder service. - * - * @var \Drupal\Core\Routing\RouteBuilderInterface - */ - protected $routeBuilder; - - /** * Constructs a new ThemeController. * * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler * The theme handler. - * @param \Drupal\Core\Routing\RouteBuilderInterface $route_builder - * The route builder. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. */ - public function __construct(ThemeHandlerInterface $theme_handler, RouteBuilderInterface $route_builder, ConfigFactoryInterface $config_factory) { + public function __construct(ThemeHandlerInterface $theme_handler,ConfigFactoryInterface $config_factory) { $this->themeHandler = $theme_handler; $this->configFactory = $config_factory; - $this->routeBuilder = $route_builder; } /** @@ -58,7 +48,6 @@ public function __construct(ThemeHandlerInterface $theme_handler, RouteBuilderIn public static function create(ContainerInterface $container) { return new static( $container->get('theme_handler'), - $container->get('router.builder'), $container->get('config.factory') ); } @@ -183,8 +172,6 @@ public function setDefaultTheme(Request $request) { // Set the default theme. $config->set('default', $theme)->save(); - $this->routeBuilder->setRebuildNeeded(); - // The status message depends on whether an admin theme is currently in // use: a value of 0 means the admin theme is set to be the default // theme. diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php index a782e15..7f02517 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -110,7 +110,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme = // Default settings are defined in theme_get_setting() in includes/theme.inc if ($theme) { - // Deny access if the theme is not installed or not found. if (!$this->themeHandler->hasUi($theme)) { throw new NotFoundHttpException(); } diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php index 2f636d9..278353d 100644 --- a/core/modules/system/src/Tests/System/ThemeTest.php +++ b/core/modules/system/src/Tests/System/ThemeTest.php @@ -54,7 +54,7 @@ function testThemeSettings() { $this->assertResponse(404, 'The theme settings form URL for a non-existent theme could not be found.'); $this->assertTrue(\Drupal::service('theme_installer')->install(['stable'])); $this->drupalGet('admin/appearance/settings/stable'); - $this->assertResponse(404, 'The theme settings form URL for a hidden theme are unavailable.'); + $this->assertResponse(404, 'The theme settings form URL for a hidden theme is unavailable.'); // Specify a filesystem path to be used for the logo. $file = current($this->drupalGetTestFiles('image')); @@ -194,7 +194,7 @@ function testThemeSettings() { $this->assertNoFieldByName('logo_path'); $this->drupalPostForm(NULL, [], t('Save configuration')); - // Ensure only vlaid themes are listed in the local tasks. + // Ensure only valid themes are listed in the local tasks. $this->drupalPlaceBlock('local_tasks_block', ['region' => 'header']); $this->drupalGet('admin/appearance/settings'); $theme_handler = \Drupal::service('theme_handler'); @@ -209,7 +209,7 @@ function testThemeSettings() { $this->drupalGet('admin/appearance/settings'); $this->assertLink($theme_handler->getName('stable')); $this->drupalGet('admin/appearance/settings/stable'); - $this->assertResponse(200, 'The theme settings form URL for a hidden theme that is the admin theme are avialable.'); + $this->assertResponse(200, 'The theme settings form URL for a hidden theme that is the admin theme is available.'); } /** @@ -277,7 +277,7 @@ function testAdministrationTheme() { function testSwitchDefaultTheme() { /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ $theme_handler = \Drupal::service('theme_handler'); - // First, Install Stark and set it as the default theme programmatically. + // First, install Stark and set it as the default theme programmatically. $theme_handler->install(array('stark')); $theme_handler->setDefault('stark');