Needs work
Project:
Drupal core
Version:
main
Component:
configuration system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Jan 2024 at 10:57 UTC
Updated:
8 Jan 2024 at 14:19 UTC
Jump to comment: Most recent
Surfaced at #3397493: Add validation constraints to block_content.type.*, specifically at https://git.drupalcode.org/project/drupal/-/merge_requests/5170/diffs#no...
#3404061: When setting `NotNull` constraint on type: required_label, two validation errors appear improved the DX for using NotBlank in the "required value" case.
But turns out that in the "optional value" case, we can improve it too!
Always set $constraints['NotBlank']['allowNull'] = TRUE; because:
nullable: false, which is the default), null will trigger the NotNull constraint, and NotBlank should not generate an equivalent message againnullable: true, which must be explicitly specified), then null is a valid value and NotBlank should not complainnode.schema.yml.None.
None.
None.
None.
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
Comment #3
wim leersComment #4
wim leersThis relates to #3364109: Configuration schema & required values: add test coverage for `nullable: true` validation support and so I linked this issue from the change record from that cluster of issues: https://www.drupal.org/node/3404425
Comment #5
wim leersComment #6
phenaproximaComment #7
wim leers