Problem/Motivation
Currently the form element for defining which enum the field corresponds to is a simple text field. If you for any reason input an invalid value then there is no feedback anywhere. The only way to determine this is by checking out the default value configuration or trying to use the field on an entity. In both situations the form element will only allow a single empty value.
Steps to reproduce
- Create a new site with the enum field on https://simplytest.me/
- Create a new select list type field on one of the existing content types
- Choose an enum value
- Write a random value in the Enum class field
- Save the field
- Create a new node of the selected content type
- See that the enum field only contains a single value "- None -"
Proposed resolution
Add validation to the enum class field which shows an error message if the input is not valid.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Issue fork enum_field-3586009
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
Comment #3
kasperg commentedComment #4
kasperg commentedComment #7
dieterholvoet commentedThanks!