diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index e3b2b9e..c3f126a 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -14,6 +14,13 @@ undefined: # type, we strongly suggest you use configuration structures that can be # described with other structural elements of schema, and describe your schema # with those elements. +any: + label: 'Any' + class: '\Drupal\Core\TypedData\Plugin\DataType\Any' + +# Explicit type to use when on top of having no explicit data typing like the +# previous one, we want the schema parser to just ignore the element, not doing +# any further type casting, validation, etc.. ignore: label: 'Ignore' class: '\Drupal\Core\Config\Schema\Ignore' diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php index 60a1d02..d340d5d 100644 --- a/core/lib/Drupal/Core/Config/StorableConfigBase.php +++ b/core/lib/Drupal/Core/Config/StorableConfigBase.php @@ -13,6 +13,7 @@ use Drupal\Core\TypedData\PrimitiveInterface; use Drupal\Core\TypedData\Type\FloatInterface; use Drupal\Core\TypedData\Type\IntegerInterface; +use Drupal\Core\TypedData\Plugin\DataType\Any; use Drupal\Core\Config\Schema\Undefined; /** @@ -179,8 +180,8 @@ protected function castValue($key, $value) { // throwing it forward. See https://drupal.org/node/2183983. // Until then, we need to handle the Undefined case below. } - // Do not cast value if it is unknown or defined to be ignored. - if ($element && ($element instanceof Undefined || $element instanceof Ignore)) { + // Do not cast value if it is any, unknown or defined to be ignored. + if ($element && ($element instanceof Any || $element instanceof Undefined || $element instanceof Ignore)) { return $value; } if (is_scalar($value) || $value === NULL) { diff --git a/core/modules/user/config/schema/user.schema.yml b/core/modules/user/config/schema/user.schema.yml index 44762ed..ce3deb4 100644 --- a/core/modules/user/config/schema/user.schema.yml +++ b/core/modules/user/config/schema/user.schema.yml @@ -161,7 +161,7 @@ search.plugin.user_search: type: sequence label: 'User search' sequence: - - type: undefined + - type: any condition.plugin.user_role: type: condition.plugin diff --git a/core/modules/views/config/schema/views.cache.schema.yml b/core/modules/views/config/schema/views.cache.schema.yml index 3e90332..4927325 100644 --- a/core/modules/views/config/schema/views.cache.schema.yml +++ b/core/modules/views/config/schema/views.cache.schema.yml @@ -8,7 +8,7 @@ views.cache.none: type: sequence label: 'Options' sequence: - - type: undefined + - type: any views.cache.tag: type: views_cache @@ -18,7 +18,7 @@ views.cache.tag: type: sequence label: 'Options' sequence: - - type: undefined + - type: any views.cache.time: type: views_cache