diff --git a/core/lib/Drupal/Core/Config/Schema/Sequence.php b/core/lib/Drupal/Core/Config/Schema/Sequence.php index 7d0ba3e..c47fd55 100644 --- a/core/lib/Drupal/Core/Config/Schema/Sequence.php +++ b/core/lib/Drupal/Core/Config/Schema/Sequence.php @@ -24,7 +24,13 @@ class Sequence extends ArrayElement { protected function getElementDefinition($key) { $value = isset($this->value[$key]) ? $this->value[$key] : NULL; // @todo: Remove BC layer for sequence with hyphen in front. https://www.drupal.org/node/2444979 - $definition = isset($this->definition['sequence'][0]) ? $this->definition['sequence'][0] : isset($this->definition['sequence']) ? $this->definition['sequence'] : array(); + $definition = array(); + if (isset($this->definition['sequence'][0])) { + $definition = $this->definition['sequence'][0]; + } + elseif ($this->definition['sequence']) { + $definition = $this->definition['sequence']; + } return $this->buildDataDefinition($definition, $value, $key); } diff --git a/core/modules/config/src/Tests/ConfigSchemaTest.php b/core/modules/config/src/Tests/ConfigSchemaTest.php index d963d45..37adff0 100644 --- a/core/modules/config/src/Tests/ConfigSchemaTest.php +++ b/core/modules/config/src/Tests/ConfigSchemaTest.php @@ -343,6 +343,7 @@ public function testConfigSaveWithSchema() { 'float' => '3.14', 'null_float' => '', 'sequence' => array (1, 0, 1), + 'sequence_bc' => array(1, 0, 1), // Not in schema and therefore should be left untouched. 'not_present_in_schema' => TRUE, // Test a custom type. @@ -365,6 +366,7 @@ public function testConfigSaveWithSchema() { 'float' => 3.14, 'null_float' => NULL, 'sequence' => array (TRUE, FALSE, TRUE), + 'sequence_bc' => array(TRUE, FALSE, TRUE), 'not_present_in_schema' => TRUE, 'config_schema_test_integer' => 1, 'config_schema_test_integer_empty_string' => NULL,