Loading core/lib/Drupal/Core/Config/TypedConfigManager.php +2 −0 Original line number Diff line number Diff line Loading @@ -298,8 +298,10 @@ protected function getDefinitionWithReplacements($base_plugin_id, array $replace } // Unset type so we try the merge only once per type. unset($definition['type']); if (!empty($replacements)) { $this->definitions[$type] = $definition; } } // Add type and default definition class. $definition += [ 'definition_class' => '\Drupal\Core\TypedData\DataDefinition', Loading core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +0 −21 Original line number Diff line number Diff line Loading @@ -785,13 +785,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.double_brackets') ->setData($untyped_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $this->assertSame($typed_values, \Drupal::config('wrapping.config_schema_test.double_brackets')->get()); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.double_brackets')->get('tests')->getElements(); Loading @@ -818,13 +811,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.double_brackets') ->setData($typed_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.double_brackets')->get('tests')->getElements(); $definition = $tests[0]->getDataDefinition()->toArray(); $this->assertEquals('wrapping.test.double_brackets.*||test.double_brackets.cat.dog', $definition['type']); Loading @@ -845,13 +831,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.other_double_brackets') ->setData($typed_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.other_double_brackets')->get('tests')->getElements(); $definition = $tests[0]->getDataDefinition()->toArray(); // Check that definition type is a merge of the expected types. Loading Loading
core/lib/Drupal/Core/Config/TypedConfigManager.php +2 −0 Original line number Diff line number Diff line Loading @@ -298,8 +298,10 @@ protected function getDefinitionWithReplacements($base_plugin_id, array $replace } // Unset type so we try the merge only once per type. unset($definition['type']); if (!empty($replacements)) { $this->definitions[$type] = $definition; } } // Add type and default definition class. $definition += [ 'definition_class' => '\Drupal\Core\TypedData\DataDefinition', Loading
core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +0 −21 Original line number Diff line number Diff line Loading @@ -785,13 +785,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.double_brackets') ->setData($untyped_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $this->assertSame($typed_values, \Drupal::config('wrapping.config_schema_test.double_brackets')->get()); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.double_brackets')->get('tests')->getElements(); Loading @@ -818,13 +811,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.double_brackets') ->setData($typed_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.double_brackets')->get('tests')->getElements(); $definition = $tests[0]->getDataDefinition()->toArray(); $this->assertEquals('wrapping.test.double_brackets.*||test.double_brackets.cat.dog', $definition['type']); Loading @@ -845,13 +831,6 @@ public function testConfigSaveWithWrappingSchemaDoubleBrackets(): void { \Drupal::configFactory()->getEditable('wrapping.config_schema_test.other_double_brackets') ->setData($typed_values) ->save(); // TRICKY: https://www.drupal.org/project/drupal/issues/2663410 introduced a // bug that made TypedConfigManager sensitive to cache pollution. Saving // config in a test triggers the schema checking and validation logic from // \Drupal\Core\Config\Development\ConfigSchemaChecker , which in turn // triggers that cache pollution bug. This is a work-around. // @todo Remove in https://www.drupal.org/project/drupal/issues/3400181 \Drupal::service('config.typed')->clearCachedDefinitions(); $tests = \Drupal::service('config.typed')->get('wrapping.config_schema_test.other_double_brackets')->get('tests')->getElements(); $definition = $tests[0]->getDataDefinition()->toArray(); // Check that definition type is a merge of the expected types. Loading