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

Command icon 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

kasperg created an issue. See original summary.

kasperg’s picture

Issue summary: View changes
kasperg’s picture

Status: Active » Needs review

dieterholvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.