Skip to content

[5.x]: Getting value invalid on save for existing entries after adding new dropdown field #14731

@mortenta

Description

@mortenta

What happened?

Description

After adding a new dropdown field to an entry type that is already in use by entries, I get an error on save saying that the field is invalid, although the default value is a seemingly selected. The only way to get past the error is to select another value, then go back and select the default value.
However, if used in a matrix, and the sub elements are inline, it seems you only have to re-select one place in order to be able to save. However, if not inline, you will have to change each element.

Steps to reproduce

  1. Have a section, an entry type with fields, and an entry
  2. Add a new field with field type dropdown to the entry type, with more than one option, and one of the options set as default.
  3. Go to the entry, and make a change to one of the other fields, and try to save
  4. The invalid error should appear. Try to change the value of the new dropdown, and save.

Expected behavior

The default value of the new dropdown(s), as shown in the UI, should be saved.

Actual behavior

An error is thrown, saying that the new dropdown field(s) are invalid.

Craft CMS version

5.0.0

PHP version

8.2.16

Operating system and version

MacOS 14

Database type and version

MySQL 8.2.0

Image driver and version

GD 8.2.16

Installed plugins and versions

Blitz 5.0.0-beta.4
CKEditor 4.0.3
Feed Me 6.x-dev
Pexels 1.0.1
SEOmatic 5.0.0-beta.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions