Problem/Motivation
system.site has 5 property path that are not yet validatable:
vendor/bin/drush config:inspect --filter-keys=system.site --detail --list-constraints
➜ 🤖 Analyzing…
Legend for Data:
✅❓ → Correct primitive type, detailed validation impossible.
✅✅ → Correct primitive type, passed all validation constraints.
---------------------------------------- --------- ------------- ------ ---------------------------------------------------------------------------------------------
Key Status Validatable Data Validation constraints
---------------------------------------- --------- ------------- ------ ---------------------------------------------------------------------------------------------
system.site Correct 69% ✅❓ ValidKeys: '<infer>'
LangcodeRequiredIfTranslatableValues: null
system.site: Correct Validatable ✅✅ ValidKeys: '<infer>'
LangcodeRequiredIfTranslatableValues: null
system.site:_core Correct Validatable ✅✅ ValidKeys:
- default_config_hash
system.site:_core.default_config_hash Correct Validatable ✅✅ NotNull: { }
Regex: '/^[a-zA-Z0-9\-_]+$/'
Length: 43
↣ PrimitiveType: { }
system.site:admin_compact_mode Correct Validatable ✅✅ ↣ PrimitiveType: { }
system.site:default_langcode Correct Validatable ✅✅ NotNull: { }
Choice:
callback: 'Drupal\Core\TypedData\Plugin\DataType\LanguageReference::getAllValidLangcodes'↣ PrimitiveType: { }
system.site:langcode Correct Validatable ✅✅ NotNull: { }
Choice:
callback: 'Drupal\Core\TypedData\Plugin\DataType\LanguageReference::getAllValidLangcodes'↣ PrimitiveType: { }
system.site:mail Correct Validatable ✅✅ Email:
message: '%value is not a valid email address.'↣ PrimitiveType: { }
system.site:mail_notification Correct NOT ✅❓ ⚠️ @todo Add validation constraints here
system.site:name Correct Validatable ✅✅ Regex:
pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control characters.'↣ PrimitiveType: { }
system.site:page Correct Validatable ✅✅ ValidKeys: '<infer>'
system.site:page.403 Correct NOT ✅❓ ⚠️ @todo Add validation constraints here
system.site:page.404 Correct NOT ✅❓ ⚠️ @todo Add validation constraints here
system.site:page.front Correct NOT ✅❓ ⚠️ @todo Add validation constraints here
system.site:slogan Correct Validatable ✅✅ Regex:
pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control characters.'↣ PrimitiveType: { }
system.site:uuid Correct Validatable ✅✅ Uuid: { }
NotNull: { }
↣ PrimitiveType: { }
system.site:weight_select_max Correct NOT ✅❓ ⚠️ @todo Add validation constraints here
---------------------------------------- --------- ------------- ------ ---------------------------------------------------------------------------------------------
Steps to reproduce
- Get a local git clone of Drupal core
11.x
. composer require drupal/config_inspector
— or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 or newer (which supports Drupal 11!)composer require drush/drush
vendor/bin/drush config:inspect --filter-keys=system.site --detail --list-constraints
Proposed resolution
Add validation constraints to:
system.site:mail_notification
system.site:page.403
system.site:page.404
system.site:page.front
system.site:weight_select_max
For examples, search *.schema.yml
files for the string constraints:
😊
Reach out to @borisson_ or @wimleers in the #distributions-and-recipes
.
Remaining tasks
User interface changes
None.
API changes
Data model changes
More validation 🚀
Release notes snippet
None.