diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index 1293574..b34dc80 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -306,7 +306,10 @@ protected function createConfiguration($collection, array $config_to_create) { $entity = $entity_storage->createFromStorageRecord($new_config->get()); } if ($entity->isInstallable()) { - $entity->trustData()->set('defaultConfigHash', Crypt::hashBase64(serialize($new_config->get())))->save(); + $entity + ->set('default_config_hash', Crypt::hashBase64(serialize($new_config->get()))) + ->trustData() + ->save(); } } else { diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 0d464c5..70144d2 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -106,7 +106,7 @@ /** * @var string */ - protected $defaultConfigHash = ''; + protected $default_config_hash = ''; /** * Trust supplied data and not use configuration schema on save. @@ -301,8 +301,8 @@ public function toArray() { if (empty($this->third_party_settings)) { unset($properties['third_party_settings']); } - if (empty($this->defaultConfigHash)) { - unset($properties['defaultConfigHash']); + if (empty($this->default_config_hash)) { + unset($properties['default_config_hash']); } return $properties; } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php index 8fabf36..b29f803 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php @@ -157,7 +157,7 @@ public function getPropertiesToExport() { 'status' => 'status', 'dependencies' => 'dependencies', 'third_party_settings' => 'third_party_settings', - 'defaultConfigHash' => 'default_config_hash', + 'default_config_hash' => 'default_config_hash', ]; foreach ($this->config_export as $property => $name) { if (is_numeric($property)) { diff --git a/core/modules/config/src/Tests/ConfigSchemaTest.php b/core/modules/config/src/Tests/ConfigSchemaTest.php index a94e26a..3c7980c 100644 --- a/core/modules/config/src/Tests/ConfigSchemaTest.php +++ b/core/modules/config/src/Tests/ConfigSchemaTest.php @@ -179,6 +179,8 @@ function testSchemaMapping() { $expected['mapping']['third_party_settings']['type'] = 'sequence'; $expected['mapping']['third_party_settings']['label'] = 'Third party settings'; $expected['mapping']['third_party_settings']['sequence']['type'] = '[%parent.%parent.%type].third_party.[%key]'; + $expected['mapping']['default_config_hash']['type'] = 'string'; + $expected['mapping']['default_config_hash']['label'] = 'Default configuration hash'; $expected['type'] = 'image.style.*'; $this->assertEqual($definition, $expected); diff --git a/core/tests/Drupal/KernelTests/AssertConfigTrait.php b/core/tests/Drupal/KernelTests/AssertConfigTrait.php index 24d393e..8489ae7 100644 --- a/core/tests/Drupal/KernelTests/AssertConfigTrait.php +++ b/core/tests/Drupal/KernelTests/AssertConfigTrait.php @@ -79,6 +79,10 @@ protected function assertConfigDiff(Diff $result, $config_name, array $skipped_c if (strpos($closing, 'uuid: ') === 0) { continue; } + // The UUIDs don't exist in the default config. + if (strpos($closing, 'default_config_hash: ') === 0) { + continue; + } throw new \Exception($config_name . ': ' . var_export($op, TRUE)); } break; diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php index 97bf172..44eae9a 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityTypeTest.php @@ -163,6 +163,7 @@ public function providerGetPropertiesToExport() { 'status' => 'status', 'dependencies' => 'dependencies', 'third_party_settings' => 'third_party_settings', + 'default_config_hash' => 'default_config_hash', 'id' => 'id', 'custom_property' => 'customProperty', ],