Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is currently possible to programmatically create config entities with invalid machine names.
Form UI typically enforces "Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character".
This issue also means that if go to edit a configuration entity, the form will no longer submit because an invalid machine name was used
Non exhaustive list of configuration entities which make use of machine name in their forms:
Config | Current behaviour | Issue |
---|---|---|
Block | Invalid machine name permitted | |
FieldStorageConfig | Throws exception on create (Attempt to create a field storage xyz with invalid characters) | - |
Node type | Invalid machine name permitted | |
Role | Invalid machine name permitted | #2824519: User role machine name created with caps and spaces |
Vocabulary | Invalid machine name permitted | |
Comments
Comment #2
dpiComment #3
dpiIs it worth duplicating the same logic as
\Drupal\field\Entity\FieldStorageConfig
to other config types?Comment #10
bircherComment #15
larowlan#2920678: Add config validation for the allowed characters of machine names