Mercurial > hg > cmmr2012-drupal-site
diff core/lib/Drupal/Core/Extension/ThemeInstaller.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php Thu May 09 15:34:47 2019 +0100 @@ -174,22 +174,12 @@ ->set("theme.$key", 0) ->save(TRUE); - // Add the theme to the current list. - // @todo Remove all code that relies on $status property. - $theme_data[$key]->status = 1; - $this->themeHandler->addTheme($theme_data[$key]); - - // Update the current theme data accordingly. - $current_theme_data = $this->state->get('system.theme.data', []); - $current_theme_data[$key] = $theme_data[$key]; - $this->state->set('system.theme.data', $current_theme_data); - // Reset theme settings. $theme_settings = &drupal_static('theme_get_setting'); unset($theme_settings[$key]); - // @todo Remove system_list(). - $this->systemListReset(); + // Reset theme listing. + $this->themeHandler->reset(); // Only install default configuration if this theme has not been installed // already. @@ -245,14 +235,10 @@ } $this->cssCollectionOptimizer->deleteAll(); - $current_theme_data = $this->state->get('system.theme.data', []); foreach ($theme_list as $key) { // The value is not used; the weight is ignored for themes currently. $extension_config->clear("theme.$key"); - // Update the current theme data accordingly. - unset($current_theme_data[$key]); - // Reset theme settings. $theme_settings = &drupal_static('theme_get_setting'); unset($theme_settings[$key]); @@ -264,11 +250,10 @@ // Don't check schema when uninstalling a theme since we are only clearing // keys. $extension_config->save(TRUE); - $this->state->set('system.theme.data', $current_theme_data); - // @todo Remove system_list(). - $this->themeHandler->refreshInfo(); + // Refresh theme info. $this->resetSystem(); + $this->themeHandler->reset(); $this->moduleHandler->invokeAll('themes_uninstalled', [$theme_list]); } @@ -280,7 +265,6 @@ if ($this->routeBuilder) { $this->routeBuilder->setRebuildNeeded(); } - $this->systemListReset(); // @todo It feels wrong to have the requirement to clear the local tasks // cache here. @@ -295,11 +279,4 @@ drupal_theme_rebuild(); } - /** - * Wraps system_list_reset(). - */ - protected function systemListReset() { - system_list_reset(); - } - }