Problem/Motivation
Discovered in #3364109: Configuration schema & required values: add test coverage for `nullable: true` validation support.
For example:
1) Drupal\Tests\node\Kernel\NodeTypeValidationTest::testEntityIsValid
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for node.type.kddiqdxr with the following errors: 0 [description] This value should not be null., 1 [help] This value should not be null.
Steps to reproduce
Run Drupal core's test suite with #3364109: Configuration schema & required values: add test coverage for `nullable: true` validation support applied, and with the lines
'node.type.*' => [
// @todo Fix config or tweak schema of `type: node.type.*`.
// @see node.schema.yml
'name' => [
'This value should not be null.',
],
'description' => [
'This value should not be null.',
],
'help' => [
'This value should not be null.',
],
],
removed from \Drupal\Core\Config\Schema\SchemaCheckTrait::checkConfigSchema().
Proposed resolution
Solution:
name- Every config entity type may have a listing, so labels are essential. All node type config entities that do not have a label are currently not usable in the admin UI.
description- Either:
- add
description: ''to every singlenode.type.*.ymlfile and'description' => '',to every singleNodeType::create(…)call - or update
\Drupal\block\Entity\NodeType::$descriptionto default to''.
- add
node.schema.yml to allow description. to be null: add nullable: true (because it seems like it really should be optional and then the empty string makes no sense).
provider … but this would be a BC break for \Drupal\node\NodeTypeInterface::getDescription() whose API docs claim it always returns a string.helpdescription.⚠️ … but also wait for the remainder of node.type.* to become validatable? The following property paths are not yet validatable at this time:
preview_mode→ happening in #3379091: Make NodeType config entities fully validatable 👍
Remaining tasks
Fix all of these failures.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A
Comments
Comment #2
wim leersI missed that
preview_modeis not yet validatable.Comment #3
wim leersComment #4
wim leers#3379091: Make NodeType config entities fully validatable itself is now postponed, so increasing blockedness.
Comment #5
wim leersThis is all happening in #3379091: Make NodeType config entities fully validatable 👍