diff --git a/core/lib/Drupal/Core/Config/Schema/Sequence.php b/core/lib/Drupal/Core/Config/Schema/Sequence.php index 8e715baf670..66a5c3a36f8 100644 --- a/core/lib/Drupal/Core/Config/Schema/Sequence.php +++ b/core/lib/Drupal/Core/Config/Schema/Sequence.php @@ -28,6 +28,8 @@ class Sequence extends ArrayElement { $definition = []; if (isset($this->definition['sequence'][0])) { $definition = $this->definition['sequence'][0]; + $bc_sequence_location = $this->getPropertyPath(); + @trigger_error("The definition for the '$bc_sequence_location' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603", E_USER_DEPRECATED); } elseif ($this->definition['sequence']) { $definition = $this->definition['sequence']; diff --git a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml index 4dae8329048..2ef49605513 100644 --- a/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml +++ b/core/modules/config/tests/config_schema_test/config/schema/config_schema_test.schema.yml @@ -120,6 +120,7 @@ config_schema_test.schema_data_types: type: sequence sequence: type: boolean + # @see \Drupal\Core\Config\Schema\Sequence::getElementDefinition() sequence_bc: type: sequence sequence: @@ -220,7 +221,7 @@ wrapping.config_schema_test.plugin_types: tests: type: sequence sequence: - - type: wrapping.test.plugin_types.[plugin_id] + type: wrapping.test.plugin_types.[plugin_id] wrapping.test.plugin_types.*: type: test.plugin_types.[plugin_id] @@ -240,7 +241,7 @@ wrapping.config_schema_test.double_brackets: tests: type: sequence sequence: - - type: wrapping.test.double_brackets.[another_key] + type: wrapping.test.double_brackets.[another_key] wrapping.test.double_brackets.*: type: test.double_brackets.[foo].[bar] @@ -277,7 +278,7 @@ wrapping.config_schema_test.other_double_brackets: tests: type: sequence sequence: - - type: wrapping.test.other_double_brackets.[id] + type: wrapping.test.other_double_brackets.[id] wrapping.test.other_double_brackets.*: type: test.double_brackets.[id] @@ -305,36 +306,36 @@ config_schema_test.schema_sequence_sort: type: sequence orderby: key sequence: - - type: string + type: string value_sort: type: sequence orderby: value sequence: - - type: string + type: string no_sort: type: sequence sequence: - - type: string + type: string complex_sort_value: type: sequence orderby: value sequence: - - type: mapping - mapping: - foo: - type: string - bar: - type: string + type: mapping + mapping: + foo: + type: string + bar: + type: string complex_sort_key: type: sequence orderby: key sequence: - - type: mapping - mapping: - foo: - type: string - bar: - type: string + type: mapping + mapping: + foo: + type: string + bar: + type: string config_schema_test.schema_mapping_sort: type: config_object diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php index 8a0d99bfcde..f5f9df5385f 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php @@ -352,6 +352,8 @@ class ConfigSchemaTest extends KernelTestBase { /** * Tests configuration value data type enforcement using schemas. + * + * @group legacy */ public function testConfigSaveWithSchema() { $untyped_values = [ @@ -399,6 +401,7 @@ class ConfigSchemaTest extends KernelTestBase { ]; // Save config which has a schema that enforces types. + $this->expectDeprecation("The definition for the 'config_schema_test.schema_data_types.sequence_bc' sequence declares the type of its items in a way that is deprecated in drupal:8.0.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/2442603"); $this->config('config_schema_test.schema_data_types') ->setData($untyped_to_typed) ->save();