diff -u b/core/includes/config.inc b/core/includes/config.inc --- b/core/includes/config.inc +++ b/core/includes/config.inc @@ -1,8 +1,5 @@ $file) { - // Load config data into the active store and write it out to the - // file system in the drupal config directory. Note the config name - // needs to be the same as the file name WITHOUT the extension. - $config_name = basename($file, '.' . FileStorage::getFileExtension()); - - $database_storage = new DatabaseStorage($config_name); - $file_storage = new FileStorage($config_name); - $file_storage->setPath($module_config_dir); - $database_storage->write($file_storage->read()); + // Load config data into the config store. This will write it to the + // cache, database and file storage layers. + $config_store->importFile($file); } } } @@ -59,7 +51,7 @@ * @todo http://drupal.org/node/1552396 renames this into config_load_all(). */ function config_get_storage_names_with_prefix($prefix = '') { - return DatabaseStorage::getNamesWithPrefix($prefix); + return Drupal\Core\Config\DatabaseStorage::getNamesWithPrefix($prefix); } /** diff -u b/core/lib/Drupal/Core/Config/ConfigStore.php b/core/lib/Drupal/Core/Config/ConfigStore.php --- b/core/lib/Drupal/Core/Config/ConfigStore.php +++ b/core/lib/Drupal/Core/Config/ConfigStore.php @@ -89,12 +89,24 @@ $this->file->write($data); } - function importfile($path_to_config_directory) { - $import_storage = new FileStorage($this->name); - $import_storage->setPath($path_to_config_directory); + /* + * Imports a file to the config store. + */ + function importFile($path_to_file) { + // The config name needs to be the same as the file name WITHOUT the + // extension. + $config_name = basename($path_to_file, '.' . FileStorage::getFileExtension()); + $this->setName($config_name); + + // Create a storage object to load the file. + $import_storage = new FileStorage($config_name); + $import_storage->setPath(dirname($path_to_file)); $this->import($import_storage); } + /* + * Imports a storage object to the config store. + */ function import(StorageInterface $import_storage) { $data = $import_storage->read(); $this->write($data); diff -u b/core/lib/Drupal/Core/Config/DrupalConfig.php b/core/lib/Drupal/Core/Config/DrupalConfig.php --- b/core/lib/Drupal/Core/Config/DrupalConfig.php +++ b/core/lib/Drupal/Core/Config/DrupalConfig.php @@ -218,7 +218,7 @@ * Deletes the configuration object. */ public function delete() { - $this->data = array(); + $this->data = FALSE; $this->storage->delete(); } } only in patch2: unchanged: --- a/core/modules/image/image.test +++ b/core/modules/image/image.test @@ -537,6 +537,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase { $this->assertFalse(is_dir($directory), t('Image style %style directory removed on style deletion.', array('%style' => $style['name']))); drupal_static_reset('image_styles'); + drupal_static_reset('DrupalConfigStatic-' . 'image.style.' . $style_name); $this->assertFalse(image_style_load($style_name), t('Image style %style successfully deleted.', array('%style' => $style['name']))); }