diff --git a/core/includes/module.inc b/core/includes/module.inc index 6064e05..b5d189c 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('core.extension')->get('theme'); + $enabled_themes = \Drupal::config('core.extension')->get('theme') ?: array(); // @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. diff --git a/core/includes/update.inc b/core/includes/update.inc index 0bca244..56fc1ff 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -23,21 +23,22 @@ * Disables any extensions that are incompatible with the current core version. */ function update_fix_compatibility() { + $extension_config = \Drupal::config('core.extension'); + $save = FALSE; foreach (array('module', 'theme') as $type) { - $config = \Drupal::config("system.$type"); - $save = FALSE; - foreach ($config->get('enabled') as $name => $weight) { + foreach ($extension_config->get($type) as $name => $weight) { if (update_check_incompatibility($name, $type)) { - $config->clear("enabled.$name"); + $extension_config->clear("$type.$name"); + if ($type === 'theme') { + $extension_config->set("disabled.theme.$name", 0); + } $save = TRUE; } } - if ($save) { - if ($type == 'module') { - $config->set('enabled', module_config_sort($config->get('enabled'))); - } - $config->save(); - } + } + if ($save) { + $extension_config->set('module', module_config_sort($extension_config->get('module'))); + $extension_config->save(); } } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/TestInstallStorage.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/TestInstallStorage.php index cefb13f..f85de95 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/TestInstallStorage.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/TestInstallStorage.php @@ -23,11 +23,11 @@ class TestInstallStorage extends InstallStorage { */ protected function getAllFolders() { if (!isset($this->folders)) { + $this->folders = $this->getComponentNames('core', array('core')); // @todo Refactor getComponentNames() to use the extension list directly. $listing = new ExtensionDiscovery(); - // Test all profiles. $listing->setProfileDirectories(array()); - $this->folders = $this->getComponentNames('profile', array_keys($listing->scan('profile'))); + $this->folders += $this->getComponentNames('profile', array_keys($listing->scan('profile'))); $this->folders += $this->getComponentNames('module', array_keys($listing->scan('module'))); $this->folders += $this->getComponentNames('theme', array_keys($listing->scan('theme'))); } diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/TestSchemaStorage.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/TestSchemaStorage.php index 34b8642..dd782a9 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/TestSchemaStorage.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/TestSchemaStorage.php @@ -30,9 +30,10 @@ public function __construct() { */ protected function getAllFolders() { if (!isset($this->folders)) { + $this->folders = $this->getComponentNames('core', array('core')); // @todo Refactor getComponentNames() to use the extension list directly. $listing = new ExtensionDiscovery(); - $this->folders = $this->getBaseDataTypeSchema(); + $listing->setProfileDirectories(array()); $this->folders += $this->getComponentNames('profile', array_keys($listing->scan('profile'))); $this->folders += $this->getComponentNames('module', array_keys($listing->scan('module'))); $this->folders += $this->getComponentNames('theme', array_keys($listing->scan('theme')));