diff --git a/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php b/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php index f3aba3b..36a0d1a 100644 --- a/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php @@ -34,6 +34,9 @@ class ConfigInstallProfileOverrideTest extends WebTestBase { * Tests install profile config changes. */ function testInstallProfileConfigOverwrite() { + // Ensure that an install profile can provide an site uuid. + $this->assertIdentical('842049cb-67f6-469a-8000-fa4a307ea577', $this->config('system.site')->get('uuid'), 'Install profiles can override system.site::uuid.'); + $config_name = 'system.cron'; // The expected configuration from the system module. $expected_original_data = array( diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 44212b1..817e243 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -843,7 +843,9 @@ function system_install() { // Populate the site UUID and default name (if not set). $site = \Drupal::configFactory()->getEditable('system.site'); - $site->set('uuid', \Drupal::service('uuid')->generate()); + if (!$site->get('uuid')) { + $site->set('uuid', \Drupal::service('uuid')->generate()); + } if (!$site->get('name')) { $site->set('name', 'Drupal'); } diff --git a/core/profiles/testing_config_overrides/config/install/system.site.yml b/core/profiles/testing_config_overrides/config/install/system.site.yml new file mode 100644 index 0000000..db5fb2f --- /dev/null +++ b/core/profiles/testing_config_overrides/config/install/system.site.yml @@ -0,0 +1,12 @@ +uuid: 842049cb-67f6-469a-8000-fa4a307ea577 +name: 'Test profile for config overrides' +mail: admin@example.com +slogan: '' +page: + 403: '' + 404: '' + front: /node +admin_compact_mode: false +weight_select_max: 100 +langcode: en +default_langcode: en