diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index 3cb2f8c..d75df89 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -21,7 +21,7 @@ uri: # Undefined type to use for missing schema, don't use explicitly. undefined: label: 'Undefined' - class: '\Drupal\Core\Config\Schema\Property' + class: '\Drupal\Core\Config\Schema\Undefined' # Explicit type when no data typing is possible. Avoid if at all possible. ignore: diff --git a/core/lib/Drupal/Core/Config/Schema/Undefined.php b/core/lib/Drupal/Core/Config/Schema/Undefined.php index d7e4b60..6e98a1a 100644 --- a/core/lib/Drupal/Core/Config/Schema/Undefined.php +++ b/core/lib/Drupal/Core/Config/Schema/Undefined.php @@ -2,21 +2,13 @@ /** * @file - * Contains \Drupal\Core\Config\Schema\Sequence. + * Contains \Drupal\Core\Config\Schema\Undefined. */ namespace Drupal\Core\Config\Schema; /** - * Generic configuration property. + * Undefined configuration element. */ -class Property extends Element { - - /** - * Implements TypedDataInterface::validate(). - */ - public function validate() { - return isset($this->value); - } - +class Undefined extends Element { } diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php index c399857..e5b313d 100644 --- a/core/lib/Drupal/Core/Config/StorableConfigBase.php +++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php @@ -13,7 +13,7 @@ use Drupal\Core\TypedData\PrimitiveInterface; use Drupal\Core\TypedData\Type\FloatInterface; use Drupal\Core\TypedData\Type\IntegerInterface; -use Drupal\Core\Config\Schema\Property; +use Drupal\Core\Config\Schema\Undefined; /** * Provides a base class for configuration objects with storage support. @@ -178,7 +178,7 @@ protected function castValue($key, $value) { // Fix as part of https://drupal.org/node/2183983. } // Do not cast value if it is unknown or defined to be ignored. - if ($element && ($element instanceof Property || $element instanceof Ignore)) { + if ($element && ($element instanceof Undefined || $element instanceof Ignore)) { return $value; } if ((is_scalar($value) || $value === NULL)) { diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index 647d00f..f587c6e 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -326,10 +326,9 @@ protected function replaceVariable($value, $data) { * {@inheritdoc} */ public function hasConfigSchema($name) { - // The schema system falls back on the Property class for unknown types. - // See http://drupal.org/node/1905230 + // The schema system falls back on the Undefined class for unknown types. $definition = $this->getDefinition($name); - return is_array($definition) && ($definition['class'] != '\Drupal\Core\Config\Schema\Property'); + return is_array($definition) && ($definition['class'] != '\Drupal\Core\Config\Schema\Undefined'); } } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php index 71cdadf..8b129bc 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php @@ -45,7 +45,7 @@ function testSchemaMapping() { $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.no_such_key'); $expected = array(); $expected['label'] = 'Unknown'; - $expected['class'] = '\Drupal\Core\Config\Schema\Property'; + $expected['class'] = '\Drupal\Core\Config\Schema\Undefined'; $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.'); // Configuration file without schema will return Unknown as well. @@ -68,13 +68,13 @@ function testSchemaMapping() { $definition = $config['testitem']->getDataDefinition(); $expected = array(); $expected['label'] = 'Test item'; - $expected['class'] = '\Drupal\Core\Config\Schema\Property'; + $expected['class'] = '\Drupal\Core\Config\Schema\Undefined'; $expected['type'] = 'undefined'; $this->assertEqual($definition, $expected, 'Automatic type detected for a scalar is undefined.'); $definition = $config['testlist']->getDataDefinition(); $expected = array(); $expected['label'] = 'Test list'; - $expected['class'] = '\Drupal\Core\Config\Schema\Property'; + $expected['class'] = '\Drupal\Core\Config\Schema\Undefined'; $expected['type'] = 'undefined'; $this->assertEqual($definition, $expected, 'Automatic type detected for a list is undefined.'); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php index a1a43e2..02e7027 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php @@ -7,7 +7,6 @@ namespace Drupal\config\Tests; -use Drupal\Core\Config\Schema\Property; use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\TypedData\Type\BooleanInterface; use Drupal\Core\TypedData\Type\StringInterface;