Skip to content
Snippets Groups Projects
Unverified Commit 6c6c22c3 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3417363 by narendraR, Wim Leers, catch, phenaproxima, alexpott: Add...

Issue #3417363 by narendraR, Wim Leers, catch, phenaproxima, alexpott: Add validation constraints to field_ui.settings
parent 973b6ec1
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,23 @@
field_ui.settings:
type: config_object
label: 'Field UI settings'
constraints:
FullyValidatable: ~
mapping:
field_prefix:
type: string
label: 'The prefix for new fields created via Field UI'
constraints:
Regex:
# @see \Drupal\field\Entity\FieldStorageConfig::__construct()
pattern: '/^[_a-z]+[_a-z0-9]*$/'
message: "The %value prefix is not valid."
Length:
# The maximum length of the field name is 32 characters. This maximum
# length also encompasses the length of the field_prefix, which is
# capped at 30 characters here. By setting the field_ui.settings:field_prefix config
# to its maximum length, only two characters will remain available
# for the actual field name based on the above specified pattern.
# @see \Drupal\field\Entity\FieldStorageConfig::NAME_MAX_LENGTH
# @see \Drupal\field\Entity\FieldStorageConfig::preSaveNew()
max: 30
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment