You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entries with empty dropdown fields are not able to be saved because of 'Invalid' error.
Description
We have several Dropdown fields that do not have a Default option selected in the field settings, thus creating many entries with 'undefined' or null dropdown data. Upon updating from Craft 4.3.6.1 to 4.4.7.1, our authors noticed that when saving an entry with one of these 'empty' dropdown fields, it would now produce an error that prevented saving the entry.
I would assume that if defining a dropdown option is required for an entry to be saved, you would also be required to select a Default option when creating the field itself. However, you are able to create and define Dropdown fields with no Default option checked. Once that field is used on an entry it must be defined by the author for the entry to be saved.
Error
Field Settings
Steps to reproduce
Create a new dropdown field. Do not check a Default option.
Add your dropdown field to an entry type (existing or new)
Create/navigate to an existing entry type
Do not select a dropdown option as the field is not required
Click Create Entry or Save Entry
Empty dropdown produces an 'Invalid' error and entry cannot be saved
Expected behavior
I would expect either Craft to accept an 'empty' dropdown on an entry when no Default option is defined on the field settings. Or, if the dropdown needs to be defined, there should be a similar error when creating a new Dropdown field prompting the user to check a Default option. Otherwise, the latter scenario essentially makes any dropdown field without a Default defined in the field settings a required field for the author.
Actual behavior
Any field without a Default option defined in the field settings needs to be defined by an author. Dropdowns cannot be 'empty'. No indication of this when creating fields on the back-end.
Craft CMS version
4.4.7.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
That’s currently the expected behaviour. We recently enhanced the validation of the dropdown fields to make sure that only values defined in the field’s settings are allowed. So in order to allow for an empty value to be saved, you should specify one in the field’s settings. Or, you can choose a default value for the field (it will only be applied to the new entries, though).
That being said, we will discuss this part internally, and I’ll provide an update afterwards:
I would assume that if defining a dropdown option is required for an entry to be saved, you would also be required to select a Default option when creating the field itself. However, you are able to create and define Dropdown fields with no Default option checked.
Craft 4.5.0 is out with an improvement to Dropdown field behavior: now if a Dropdown field’s value is invalid, and the field contains an explicit Default option, the default option will be auto-selected, and the field will be marked as changed. (#13540)
What happened?
Entries with empty dropdown fields are not able to be saved because of 'Invalid' error.
Description
We have several Dropdown fields that do not have a Default option selected in the field settings, thus creating many entries with 'undefined' or null dropdown data. Upon updating from Craft 4.3.6.1 to 4.4.7.1, our authors noticed that when saving an entry with one of these 'empty' dropdown fields, it would now produce an error that prevented saving the entry.
I would assume that if defining a dropdown option is required for an entry to be saved, you would also be required to select a Default option when creating the field itself. However, you are able to create and define Dropdown fields with no Default option checked. Once that field is used on an entry it must be defined by the author for the entry to be saved.
Error
![Screen Shot 2023-04-27 at 4 04 59 PM](https://user-images.githubusercontent.com/66807975/234991005-b3ed8de3-f703-42e9-a91c-d2cd836f6912.png)
Field Settings
![Screen Shot 2023-04-27 at 4 05 53 PM](https://user-images.githubusercontent.com/66807975/234991279-e6c729bf-c29c-478f-b52b-f5c7beb94817.png)
Steps to reproduce
Expected behavior
I would expect either Craft to accept an 'empty' dropdown on an entry when no Default option is defined on the field settings. Or, if the dropdown needs to be defined, there should be a similar error when creating a new Dropdown field prompting the user to check a Default option. Otherwise, the latter scenario essentially makes any dropdown field without a Default defined in the field settings a required field for the author.
Actual behavior
Any field without a Default option defined in the field settings needs to be defined by an author. Dropdowns cannot be 'empty'. No indication of this when creating fields on the back-end.
Craft CMS version
4.4.7.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: