diff --git a/core/modules/config/src/Controller/ConfigController.php b/core/modules/config/src/Controller/ConfigController.php index ff91637..eeec671 100644 --- a/core/modules/config/src/Controller/ConfigController.php +++ b/core/modules/config/src/Controller/ConfigController.php @@ -85,9 +85,11 @@ public function downloadExport() { file_unmanaged_delete(file_directory_temp() . '/config.tar.gz'); $archiver = new ArchiveTar(file_directory_temp() . '/config.tar.gz', 'gz'); - foreach ($this->targetStorage->listAll() as $name) { - $archiver->addString("$name.yml", Yaml::encode(\Drupal::config($name)->get())); + // Get raw configuration data without overrides. + foreach ($this->configManager->getConfigFactory()->listAll() as $name) { + $archiver->addString("$name.yml", Yaml::encode($this->configManager->getConfigFactory()->get($name)->getRawData())); } + // Get all override data from the remaining collections. foreach ($this->targetStorage->getAllCollectionNames() as $collection) { $collection_storage = $this->targetStorage->createCollection($collection); foreach ($collection_storage->listAll() as $name) { diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php index cd486fe..172804c 100644 --- a/core/modules/config/src/Tests/ConfigExportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportUITest.php @@ -7,6 +7,7 @@ namespace Drupal\config\Tests; +use Drupal\Component\Serialization\Yaml; use Drupal\Core\Archiver\Tar; use Drupal\simpletest\WebTestBase; @@ -20,7 +21,7 @@ class ConfigExportUITest extends WebTestBase { * * @var array */ - public static $modules = array('config', 'config_test'); + public static $modules = array('config', 'config_test', 'config_export_test'); public static function getInfo() { return array( @@ -73,6 +74,13 @@ function testExport() { // Assert that the downloaded archive file contents are the same as the test // site active store. $this->assertIdentical($archive_contents, $config_files); + + // Ensure the test configuration override is in effect but was not exported. + $this->assertIdentical(\Drupal::config('system.maintenance')->get('message'), 'Foo'); + $archiver->extract(file_directory_temp(), array('system.maintenance.yml')); + $file_contents = file_get_contents(file_directory_temp() . '/' . 'system.maintenance.yml'); + $exported = Yaml::decode($file_contents); + $this->assertNotIdentical($exported['message'], 'Foo'); } } diff --git a/core/modules/config/tests/config_export_test/config_export_test.info.yml b/core/modules/config/tests/config_export_test/config_export_test.info.yml new file mode 100644 index 0000000..d0ceccd --- /dev/null +++ b/core/modules/config/tests/config_export_test/config_export_test.info.yml @@ -0,0 +1,5 @@ +name: 'Configuration export test' +type: module +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/config/tests/config_export_test/config_export_test.module b/core/modules/config/tests/config_export_test/config_export_test.module new file mode 100644 index 0000000..e31566f --- /dev/null +++ b/core/modules/config/tests/config_export_test/config_export_test.module @@ -0,0 +1,9 @@ +