diff --git a/core/config/core.extension.yml b/core/config/core.extension.yml new file mode 100644 index 0000000..1514a9e --- /dev/null +++ b/core/config/core.extension.yml @@ -0,0 +1,4 @@ +module: {} +theme: {} +disabled: + theme: {} diff --git a/core/lib/Drupal/Core/Config/Schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml similarity index 100% rename from core/lib/Drupal/Core/Config/Schema/core.data_types.schema.yml rename to core/config/schema/core.data_types.schema.yml diff --git a/core/config/schema/core.extension.schema.yml b/core/config/schema/core.extension.schema.yml new file mode 100644 index 0000000..3b93d92 --- /dev/null +++ b/core/config/schema/core.extension.schema.yml @@ -0,0 +1,26 @@ +core.extension: + type: mapping + label: 'Extension settings' + mapping: + module: + type: sequence + label: 'Enabled modules' + sequence: + - type: integer + label: 'Weight' + theme: + type: sequence + label: 'Enabled themes' + sequence: + - type: integer + label: 'Weight' + disabled: + type: mapping + label: 'Disabled extensions' + mapping: + theme: + type: sequence + label: 'Disabled themes' + sequence: + - type: integer + label: 'Weight' diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index a704ebf..0404dca 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -575,6 +575,10 @@ function drupal_get_filename($type, $name, $filename = NULL) { // drupal_static(). static $files = array(); + if ($type === 'core') { + return 'core/core.info.yml'; + } + // Profiles are converted into modules in system_rebuild_module_data(). // @todo Remove false-exposure of profiles as modules. $original_type = $type; diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d335e65..38d09dc 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -954,6 +954,9 @@ function install_verify_requirements(&$install_state) { * An array of information about the current installation state. */ function install_base_system(&$install_state) { + // Install base system configuration. + \Drupal::service('config.installer')->installDefaultConfig('core', 'core'); + // Install system.module. drupal_install_system($install_state); diff --git a/core/includes/install.inc b/core/includes/install.inc index 6f61503..d080733 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -627,9 +627,6 @@ function drupal_verify_profile($install_state) { * to set the default language. */ function drupal_install_system($install_state) { - // Create tables. - drupal_install_schema('system'); - // Immediately boot a new kernel into the regular production environment. $request = \Drupal::hasRequest() ? \Drupal::request() : FALSE; @@ -642,32 +639,7 @@ function drupal_install_system($install_state) { $kernel->getContainer()->set('request', $request, 'request'); } - $system_path = drupal_get_path('module', 'system'); - require_once DRUPAL_ROOT . '/' . $system_path . '/system.install'; - - // Set the schema version to the number of the last update provided by the - // module, or the minimum core schema version. - $system_version = \Drupal::CORE_MINIMUM_SCHEMA_VERSION; - $system_versions = drupal_get_schema_versions('system'); - if ($system_versions) { - $system_version = max(max($system_versions), $system_version); - } - \Drupal::keyValue('system.schema')->set('system', $system_version); - - // System module needs to be enabled and the system/module lists need to be - // reset first in order to allow installation of default configuration to - // invoke config import callbacks. - // @todo Installation profiles may override the system.module config object. - \Drupal::config('system.module') - ->set('enabled.system', 0) - ->save(); - - // Update the module list to include it. Reboot the kernel too. - \Drupal::moduleHandler()->addModule('system', 'core/modules/system'); - $module_list = \Drupal::moduleHandler()->getModuleList(); - $kernel->updateModules($module_list); - - \Drupal::service('config.installer')->installDefaultConfig('module', 'system'); + \Drupal::moduleHandler()->install(array('system'), FALSE); // Ensure default language is saved. if (isset($install_state['parameters']['langcode'])) { @@ -675,8 +647,6 @@ function drupal_install_system($install_state) { ->set('langcode', $install_state['parameters']['langcode']) ->save(); } - - \Drupal::moduleHandler()->invoke('system', 'install'); } /** diff --git a/core/includes/module.inc b/core/includes/module.inc index 7bb0e3e..7e6339a 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -41,7 +41,7 @@ function system_list($type) { 'filepaths' => array(), ); // Build a list of themes. - $enabled_themes = (array) \Drupal::config('system.theme')->get('enabled'); + $enabled_themes = (array) \Drupal::config('core.extension')->get('theme'); // @todo Themes include all themes, including disabled/uninstalled. This // system.theme.data state will go away entirely as soon as themes have // a proper installation status. @@ -305,11 +305,11 @@ function drupal_required_modules() { */ function module_set_weight($module, $weight) { // Update the module weight in the config file that contains it. - $module_config = \Drupal::config('system.module'); - if ($module_config->get("enabled.$module") !== NULL) { + $module_config = \Drupal::config('core.extension'); + if ($module_config->get("module.$module") !== NULL) { $module_config - ->set("enabled.$module", $weight) - ->set('enabled', module_config_sort($module_config->get('enabled'))) + ->set("module.$module", $weight) + ->set('module', module_config_sort($module_config->get('module'))) ->save(); // Prepare the new module list, sorted by weight, including filenames. @@ -317,7 +317,7 @@ function module_set_weight($module, $weight) { $module_handler = \Drupal::moduleHandler(); $current_module_filenames = $module_handler->getModuleList(); $current_modules = array_fill_keys(array_keys($current_module_filenames), 0); - $current_modules = module_config_sort(array_merge($current_modules, $module_config->get('enabled'))); + $current_modules = module_config_sort(array_merge($current_modules, $module_config->get('module'))); $module_filenames = array(); foreach ($current_modules as $name => $weight) { $module_filenames[$name] = $current_module_filenames[$name]; diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 3769a7b..02fe605 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -94,8 +94,11 @@ public function installDefaultConfig($type, $name) { // Read enabled extensions directly from configuration to avoid circular // dependencies with ModuleHandler and ThemeHandler. - $enabled_extensions = array_keys((array) $this->configFactory->get('system.module')->get('enabled')); - $enabled_extensions += array_keys((array) $this->configFactory->get('system.theme')->get('enabled')); + $enabled_extensions = array(); + if ($type !== 'core') { + $enabled_extensions += array_keys((array) $this->configFactory->get('core.extension')->get('module')); + $enabled_extensions += array_keys((array) $this->configFactory->get('core.extension')->get('theme')); + } $other_module_config = array_filter($other_module_config, function ($config_name) use ($enabled_extensions) { $provider = Unicode::substr($config_name, 0, strpos($config_name, '.')); diff --git a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php index 60f4188..efaef95 100644 --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -55,13 +55,14 @@ public function reset() { protected function getAllFolders() { if (!isset($this->folders)) { $this->folders = array(); - $modules = $this->configStorage->read('system.module'); - if (isset($modules['enabled'])) { - $this->folders += $this->getComponentNames('module', array_keys($modules['enabled'])); + $this->folders += $this->getComponentNames('core', array('core')); + + $extensions = $this->configStorage->read('core.extension'); + if (!empty($extensions['module'])) { + $this->folders += $this->getComponentNames('module', array_keys($extensions['module'])); } - $themes = $this->configStorage->read('system.theme'); - if (isset($themes['enabled'])) { - $this->folders += $this->getComponentNames('theme', array_keys($themes['enabled'])); + if (!empty($extensions['theme'])) { + $this->folders += $this->getComponentNames('theme', array_keys($extensions['theme'])); } // The install profile can override module default configuration. We do diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php index eba7541..124748a 100644 --- a/core/lib/Drupal/Core/Config/InstallStorage.php +++ b/core/lib/Drupal/Core/Config/InstallStorage.php @@ -119,6 +119,7 @@ public function listAll($prefix = '') { protected function getAllFolders() { if (!isset($this->folders)) { $this->folders = array(); + $this->folders += $this->getComponentNames('core', array('core')); // @todo Refactor getComponentNames() to use the extension list directly. if ($profile = drupal_get_profile()) { $this->folders += $this->getComponentNames('profile', array($profile)); diff --git a/core/lib/Drupal/Core/Config/Schema/SchemaStorage.php b/core/lib/Drupal/Core/Config/Schema/SchemaStorage.php index 1b84dec..9f5f547 100644 --- a/core/lib/Drupal/Core/Config/Schema/SchemaStorage.php +++ b/core/lib/Drupal/Core/Config/Schema/SchemaStorage.php @@ -80,7 +80,8 @@ protected function getAllFolders() { */ protected function getBaseDataTypeSchema() { return array( - 'core.data_types.schema' => 'core/lib/Drupal/Core/Config/Schema' + 'core.data_types.schema' => 'core/config/schema', + 'core.extension.schema' => 'core/config/schema', ); } diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 8172b48..b4d84ca 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -214,8 +214,8 @@ public function discoverServiceProviders() { // Ensure we know what modules are enabled and that their namespaces are // registered. if (!isset($this->moduleList)) { - $module_list = $this->getConfigStorage()->read('system.module'); - $this->moduleList = isset($module_list['enabled']) ? $module_list['enabled'] : array(); + $module_list = $this->getConfigStorage()->read('core.extension'); + $this->moduleList = isset($module_list['module']) ? $module_list['module'] : array(); } $module_filenames = $this->getModuleFileNames(); $this->registerNamespaces($this->getModuleNamespaces($module_filenames)); @@ -414,7 +414,7 @@ protected function initializeContainer() { // If 'container.modules' is wrong, the container must be rebuilt. if (!isset($this->moduleList)) { - $this->moduleList = $this->container->get('config.factory')->get('system.module')->get('enabled'); + $this->moduleList = $this->container->get('config.factory')->get('core.extension')->get('module') ?: array(); } if (array_keys($this->moduleList) !== array_keys($container_modules)) { $persist = $this->getServicesToPersist(); diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index a20b9b9..802310e 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -533,7 +533,7 @@ public static function parseDependency($dependency) { * {@inheritdoc} */ public function install(array $module_list, $enable_dependencies = TRUE) { - $module_config = \Drupal::config('system.module'); + $module_config = \Drupal::config('core.extension'); if ($enable_dependencies) { // Get all module data so we can find dependencies and sort. $module_data = system_rebuild_module_data(); @@ -544,7 +544,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { } // Only process currently uninstalled modules. - $installed_modules = $module_config->get('enabled') ?: array(); + $installed_modules = $module_config->get('module') ?: array(); if (!$module_list = array_diff_key($module_list, $installed_modules)) { // Nothing to do. All modules already installed. return TRUE; @@ -584,7 +584,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { $modules_installed = array(); foreach ($module_list as $module) { - $enabled = $module_config->get("enabled.$module") !== NULL; + $enabled = $module_config->get("module.$module") !== NULL; if (!$enabled) { // Throw an exception if the module name is too long. if (strlen($module) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) { @@ -595,8 +595,8 @@ public function install(array $module_list, $enable_dependencies = TRUE) { } $module_config - ->set("enabled.$module", 0) - ->set('enabled', module_config_sort($module_config->get('enabled'))) + ->set("module.$module", 0) + ->set('module', module_config_sort($module_config->get('module'))) ->save(); // Prepare the new module list, sorted by weight, including filenames. @@ -610,7 +610,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) { // contained in the configured enabled modules, we assume a weight of 0. $current_module_filenames = $this->getModuleList(); $current_modules = array_fill_keys(array_keys($current_module_filenames), 0); - $current_modules = module_config_sort(array_merge($current_modules, $module_config->get('enabled'))); + $current_modules = module_config_sort(array_merge($current_modules, $module_config->get('module'))); $module_filenames = array(); foreach ($current_modules as $name => $weight) { if (isset($current_module_filenames[$name])) { @@ -712,8 +712,8 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { } // Only process currently installed modules. - $module_config = \Drupal::config('system.module'); - $installed_modules = $module_config->get('enabled') ?: array(); + $module_config = \Drupal::config('core.extension'); + $installed_modules = $module_config->get('module') ?: array(); if (!$module_list = array_intersect_key($module_list, $installed_modules)) { // Nothing to do. All modules already uninstalled. return TRUE; @@ -767,7 +767,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { drupal_uninstall_schema($module); // Remove the module's entry from the config. - $module_config->clear("enabled.$module")->save(); + $module_config->clear("module.$module")->save(); // Update the module handler to remove the module. // The current ModuleHandler instance is obsolete with the kernel rebuild diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php index 35ab1d4..3c5956c 100644 --- a/core/lib/Drupal/Core/Extension/ThemeHandler.php +++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php @@ -127,8 +127,7 @@ public function __construct(ConfigFactoryInterface $config_factory, ModuleHandle */ public function enable(array $theme_list) { $this->clearCssCache(); - $theme_config = $this->configFactory->get('system.theme'); - $disabled_themes = $this->configFactory->get('system.theme.disabled'); + $theme_config = $this->configFactory->get('core.extension'); foreach ($theme_list as $key) { // Throw an exception if the theme name is too long. if (strlen($key) > DRUPAL_EXTENSION_NAME_MAX_LENGTH) { @@ -139,8 +138,10 @@ public function enable(array $theme_list) { } // The value is not used; the weight is ignored for themes currently. - $theme_config->set("enabled.$key", 0)->save(); - $disabled_themes->clear($key)->save(); + $theme_config + ->set("theme.$key", 0) + ->clear("disabled.theme.$key") + ->save(); // Refresh the theme list as installation of default configuration needs // an updated list to work. @@ -169,15 +170,14 @@ public function disable(array $theme_list) { $this->clearCssCache(); - $theme_config = $this->configFactory->get('system.theme'); - $disabled_themes = $this->configFactory->get('system.theme.disabled'); + $theme_config = $this->configFactory->get('core.extension'); foreach ($theme_list as $key) { // The value is not used; the weight is ignored for themes currently. - $theme_config->clear("enabled.$key"); - $disabled_themes->set($key, 0); + $theme_config + ->clear("theme.$key") + ->set("disabled.theme.$key", 0); } $theme_config->save(); - $disabled_themes->save(); $this->reset(); $this->resetSystem(); diff --git a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php index 4327aac..d19557c 100644 --- a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php @@ -80,10 +80,10 @@ public function install(array $module_list, $enable_dependencies = TRUE) { } // Enable the module with a weight of 0. - $module_config = \Drupal::config('system.module'); + $module_config = \Drupal::config('core.extension'); $module_config - ->set("enabled.$module", 0) - ->set('enabled', module_config_sort($module_config->get('enabled'))) + ->set("module.$module", 0) + ->set('module', module_config_sort($module_config->get('module'))) ->save(); $current_schema = $schema_store->get($module); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php index 7188744..f2a10f3 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -75,7 +75,7 @@ function testModuleInstallation() { $this->assertIdentical($config->get('integer'), 1); // Test that uninstalling configuration removes configuration schema. - \Drupal::config('system.module')->set('enabled', array())->save(); + \Drupal::config('core.extension')->set('module', array())->save(); \Drupal::service('config.manager')->uninstall('module', 'config_test'); $this->assertFalse(\Drupal::service('config.typed')->hasConfigSchema('config_test.schema_in_install'), 'Configuration schema for config_test.schema_in_install does not exist.'); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index 7737cc8..4ac749e 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -148,7 +148,7 @@ protected function setUp() { // \Drupal\Core\Config\ConfigInstaller::installDefaultConfig() to work. // Write directly to active storage to avoid early instantiation of // the event dispatcher which can prevent modules from registering events. - \Drupal::service('config.storage')->write('system.module', array('enabled' => array())); + \Drupal::service('config.storage')->write('core.extension', array('module' => array())); // Collect and set a fixed module list. $class = get_class($this); @@ -346,14 +346,14 @@ protected function enableModules(array $modules) { // Write directly to active storage to avoid early instantiation of // the event dispatcher which can prevent modules from registering events. $active_storage = \Drupal::service('config.storage'); - $system_config = $active_storage->read('system.module'); + $system_config = $active_storage->read('core.extension'); foreach ($modules as $module) { $module_handler->addModule($module, drupal_get_path('module', $module)); // Maintain the list of enabled modules in configuration. - $system_config['enabled'][$module] = 0; + $system_config['module'][$module] = 0; } - $active_storage->write('system.module', $system_config); + $active_storage->write('core.extension', $system_config); // Update the kernel to make their services available. $module_filenames = $module_handler->getModuleList(); @@ -382,10 +382,10 @@ protected function disableModules(array $modules) { // Unset the list of modules in the extension handler. $module_handler = $this->container->get('module_handler'); $module_filenames = $module_handler->getModuleList(); - $system_config = $this->container->get('config.factory')->get('system.module'); + $system_config = $this->container->get('config.factory')->get('core.extension'); foreach ($modules as $module) { unset($module_filenames[$module]); - $system_config->clear('enabled.' . $module); + $system_config->clear('module.' . $module); } $system_config->save(); $module_handler->setModuleList($module_filenames); diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index 3a14c5c..5f8b4d4 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -274,12 +274,6 @@ system.theme: admin: type: string label: 'Administration theme' - enabled: - type: sequence - label: 'Enabled themes' - sequence: - - type: integer - label: 'Weight' default: type: string label: 'Default theme' @@ -390,17 +384,6 @@ system.mail: type: string label: 'Default' -system.module: - type: mapping - label: 'Module settings' - mapping: - enabled: - type: sequence - label: 'Enabled modules' - sequence: - - type: integer - label: 'Weight' - system.theme.global: type: mapping label: 'Theme global settings' @@ -465,10 +448,3 @@ system.theme.global: use_default: type: boolean label: 'Use default' - -system.theme.disabled: - type: sequence - label: 'Disabled themes' - sequence: - - type: integer - label: 'Weight' diff --git a/core/modules/system/config/system.theme.yml b/core/modules/system/config/system.theme.yml index e88d701..988dc48 100644 --- a/core/modules/system/config/system.theme.yml +++ b/core/modules/system/config/system.theme.yml @@ -1,4 +1,2 @@ admin: '' -enabled: - stark: 0 default: stark diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php index eaa2fc9..bcaced0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php @@ -48,7 +48,7 @@ public function testGetSchemaAtInstallTime() { */ public function testEnableUserTwice() { \Drupal::moduleHandler()->install(array('user'), FALSE); - $this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), 0); + $this->assertIdentical(\Drupal::config('core.extension')->get('module.user'), 0); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php index 463b486..cd92191 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php @@ -152,10 +152,10 @@ function testThemeSystem() { // Since visiting update.php triggers a rebuild of the theme system from an // unusual maintenance mode environment, we check that this rebuild did not // put any incorrect information about the themes into the database. - $original_theme_data = \Drupal::config('system.theme')->get('enabled'); + $original_theme_data = \Drupal::config('core.extension')->get('theme'); $this->drupalLogin($this->update_user); $this->drupalGet($this->update_url, array('external' => TRUE)); - $final_theme_data = \Drupal::config('system.theme')->get('enabled'); + $final_theme_data = \Drupal::config('core.extension')->get('theme'); $this->assertEqual($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.'); } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 7b35fca..4627392 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1287,7 +1287,7 @@ function system_rebuild_module_data() { $files = array(); ksort($modules); // Add status, weight, and schema version. - $installed_modules = (array) \Drupal::config('system.module')->get('enabled'); + $installed_modules = (array) \Drupal::config('core.extension')->get('module'); foreach ($modules as $name => $module) { $module->weight = isset($installed_modules[$name]) ? $installed_modules[$name] : 0; $module->status = (int) isset($installed_modules[$name]); @@ -1335,7 +1335,7 @@ function system_rebuild_theme_data() { // based on the current config. Remove this code when themes have a proper // installation status. // @see http://drupal.org/node/1067408 - $enabled_themes = (array) \Drupal::config('system.theme')->get('enabled'); + $enabled_themes = (array) \Drupal::config('core.extension')->get('theme'); $files = array(); foreach ($themes as $name => $theme) { $theme->status = (int) isset($enabled_themes[$name]); diff --git a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php index a184092..bcb8d0a 100644 --- a/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php +++ b/core/modules/update/lib/Drupal/update/Tests/UpdateContribTest.php @@ -206,10 +206,10 @@ function testUpdateBaseThemeSecurityUpdate() { function testUpdateShowDisabledThemes() { $update_settings = \Drupal::config('update.settings'); // Make sure all the update_test_* themes are disabled. - $theme_config = \Drupal::config('system.theme'); - foreach ($theme_config->get('enabled') as $theme => $weight) { + $theme_config = \Drupal::config('core.extension'); + foreach ($theme_config->get('theme') as $theme => $weight) { if (preg_match('/^update_test_/', $theme)) { - $theme_config->clear("enabled.$theme"); + $theme_config->clear("theme.$theme"); } } $theme_config->save(); diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php index 94df741..be72069 100644 --- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php +++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php @@ -94,7 +94,15 @@ public static function getInfo() { * {@inheritdoc} */ protected function setUp() { - $this->configFactory = $this->getConfigFactoryStub(array('system.theme' => array(), 'system.theme.disabled' => array())); + $this->configFactory = $this->getConfigFactoryStub(array( + 'core.extension' => array( + 'module' => array(), + 'theme' => array(), + 'disabled' => array( + 'theme' => array(), + ), + ), + )); $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); $this->infoParser = $this->getMock('Drupal\Core\Extension\InfoParserInterface'); @@ -128,21 +136,21 @@ public function testThemeEnableWithTooLongName() { public function testEnableSingleTheme() { $theme_list = array('theme_test'); - $this->configFactory->get('system.theme') + $this->configFactory->get('core.extension') ->expects($this->once()) ->method('set') - ->with('enabled.theme_test', 0) + ->with('theme.theme_test', 0) ->will($this->returnSelf()); - $this->configFactory->get('system.theme') + $this->configFactory->get('core.extension') ->expects($this->once()) ->method('save'); - $this->configFactory->get('system.theme.disabled') + $this->configFactory->get('core.extension') ->expects($this->once()) ->method('clear') - ->with('theme_test') + ->with('disabled.theme.theme_test') ->will($this->returnSelf()); - $this->configFactory->get('system.theme.disabled') + $this->configFactory->get('core.extension') ->expects($this->once()) ->method('save'); @@ -172,12 +180,12 @@ public function testEnableSingleTheme() { * @see \Drupal\Core\Extension\ThemeHandler::listInfo() */ public function testEnableAndListInfo() { - $this->configFactory->get('system.theme') + $this->configFactory->get('core.extension') ->expects($this->exactly(2)) ->method('set') ->will($this->returnSelf()); - $this->configFactory->get('system.theme.disabled') + $this->configFactory->get('core.extension') ->expects($this->exactly(2)) ->method('clear') ->will($this->returnSelf());