Problem/Motivation
In system.mail.yml, Drupal expects a list of mail backends under interface.
With nullable: false in the schema, the schema checker rejects interface: null. Quoting 'false' makes the same check pass.
Two methods read the nullable flag. Both ArrayElement::isNullable() and TypedConfigManager::buildDataDefinition() interpret the string 'false' as allowing NULL.
For integer 0, however, they disagree: the schema checker rejects NULL, but the data definition for fully validatable configuration allows it.
Steps to reproduce
- In the schema for
system.mail, addnullable: 'false'tointerfaceand rebuild caches. - Set
interface: nullin a copy ofsystem.mail.yml. RunSchemaCheckTrait::checkConfigSchema()on that configuration. It reports no type error forinterface. - Use
nullable: falsein the schema, rebuild caches and repeat the check. It now reports a type error forinterface.
Proposed resolution
Use BooleanInput::parse() from #3644386: "false" is interpreted as TRUE in boolean configuration in ArrayElement::isNullable() and TypedConfigManager::buildDataDefinition() to read the resolved nullable flag. Pass the schema property path for the deprecation message. If the flag is absent, keep the existing default without calling the helper. If the helper returns NULL, keep each reader's existing fallback.
For fully validatable configuration, test that both nullable: 'false' and nullable: 0 make the schema checker reject NULL and isRequired() return TRUE. Only the quoted string should trigger a deprecation.
Also cover configuration without FullyValidatable to preserve its existing required-value behavior.
Remaining tasks
Postponed on #3644386: "false" is interpreted as TRUE in boolean configuration.
User interface changes
None.
API changes
The nullable schema flag follows the boolean input rules from #3644386: "false" is interpreted as TRUE in boolean configuration. Use unquoted booleans in YAML and native booleans in PHP.
Data model changes
None.
Release notes snippet
Configuration schema now treats nullable: 'false' as FALSE and deprecates the quoted value.
Issue fork drupal-3644410
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments