Issue #2444979 by Wim Leers, webflo, borisson_, catch, Gábor Hojtsy, smustgrave: Trigger deprecation notice for old schema definition for sequence
parent
9a3156daf8
commit
15f230916a
|
@ -28,6 +28,8 @@ class Sequence extends ArrayElement {
|
||||||
$definition = [];
|
$definition = [];
|
||||||
if (isset($this->definition['sequence'][0])) {
|
if (isset($this->definition['sequence'][0])) {
|
||||||
$definition = $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']) {
|
elseif ($this->definition['sequence']) {
|
||||||
$definition = $this->definition['sequence'];
|
$definition = $this->definition['sequence'];
|
||||||
|
|
|
@ -120,6 +120,7 @@ config_schema_test.schema_data_types:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
# @see \Drupal\Core\Config\Schema\Sequence::getElementDefinition()
|
||||||
sequence_bc:
|
sequence_bc:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
|
@ -220,7 +221,7 @@ wrapping.config_schema_test.plugin_types:
|
||||||
tests:
|
tests:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
- type: wrapping.test.plugin_types.[plugin_id]
|
type: wrapping.test.plugin_types.[plugin_id]
|
||||||
|
|
||||||
wrapping.test.plugin_types.*:
|
wrapping.test.plugin_types.*:
|
||||||
type: test.plugin_types.[plugin_id]
|
type: test.plugin_types.[plugin_id]
|
||||||
|
@ -240,7 +241,7 @@ wrapping.config_schema_test.double_brackets:
|
||||||
tests:
|
tests:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
- type: wrapping.test.double_brackets.[another_key]
|
type: wrapping.test.double_brackets.[another_key]
|
||||||
|
|
||||||
wrapping.test.double_brackets.*:
|
wrapping.test.double_brackets.*:
|
||||||
type: test.double_brackets.[foo].[bar]
|
type: test.double_brackets.[foo].[bar]
|
||||||
|
@ -277,7 +278,7 @@ wrapping.config_schema_test.other_double_brackets:
|
||||||
tests:
|
tests:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
- type: wrapping.test.other_double_brackets.[id]
|
type: wrapping.test.other_double_brackets.[id]
|
||||||
|
|
||||||
wrapping.test.other_double_brackets.*:
|
wrapping.test.other_double_brackets.*:
|
||||||
type: test.double_brackets.[id]
|
type: test.double_brackets.[id]
|
||||||
|
@ -305,36 +306,36 @@ config_schema_test.schema_sequence_sort:
|
||||||
type: sequence
|
type: sequence
|
||||||
orderby: key
|
orderby: key
|
||||||
sequence:
|
sequence:
|
||||||
- type: string
|
type: string
|
||||||
value_sort:
|
value_sort:
|
||||||
type: sequence
|
type: sequence
|
||||||
orderby: value
|
orderby: value
|
||||||
sequence:
|
sequence:
|
||||||
- type: string
|
type: string
|
||||||
no_sort:
|
no_sort:
|
||||||
type: sequence
|
type: sequence
|
||||||
sequence:
|
sequence:
|
||||||
- type: string
|
type: string
|
||||||
complex_sort_value:
|
complex_sort_value:
|
||||||
type: sequence
|
type: sequence
|
||||||
orderby: value
|
orderby: value
|
||||||
sequence:
|
sequence:
|
||||||
- type: mapping
|
type: mapping
|
||||||
mapping:
|
mapping:
|
||||||
foo:
|
foo:
|
||||||
type: string
|
type: string
|
||||||
bar:
|
bar:
|
||||||
type: string
|
type: string
|
||||||
complex_sort_key:
|
complex_sort_key:
|
||||||
type: sequence
|
type: sequence
|
||||||
orderby: key
|
orderby: key
|
||||||
sequence:
|
sequence:
|
||||||
- type: mapping
|
type: mapping
|
||||||
mapping:
|
mapping:
|
||||||
foo:
|
foo:
|
||||||
type: string
|
type: string
|
||||||
bar:
|
bar:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
config_schema_test.schema_mapping_sort:
|
config_schema_test.schema_mapping_sort:
|
||||||
type: config_object
|
type: config_object
|
||||||
|
|
|
@ -352,6 +352,8 @@ class ConfigSchemaTest extends KernelTestBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests configuration value data type enforcement using schemas.
|
* Tests configuration value data type enforcement using schemas.
|
||||||
|
*
|
||||||
|
* @group legacy
|
||||||
*/
|
*/
|
||||||
public function testConfigSaveWithSchema() {
|
public function testConfigSaveWithSchema() {
|
||||||
$untyped_values = [
|
$untyped_values = [
|
||||||
|
@ -399,6 +401,7 @@ class ConfigSchemaTest extends KernelTestBase {
|
||||||
];
|
];
|
||||||
|
|
||||||
// Save config which has a schema that enforces types.
|
// 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')
|
$this->config('config_schema_test.schema_data_types')
|
||||||
->setData($untyped_to_typed)
|
->setData($untyped_to_typed)
|
||||||
->save();
|
->save();
|
||||||
|
|
Loading…
Reference in New Issue