Problem/Motivation

The new UI for creating and modifying Selection Fields with Integer values has a validation test that flags a value of zero (0) as not a value, throwing an error of "Value field is required." However, this was not a requirement in the past, so existing sites upgraded to a version of Drupal with this new UI can have existing selection fields with one of the integer values being zero (0). Because of this bug, it's impossible to update one of those fields to change an existing option or add a new option, as the UI always throws that "Value field is required" error. And, there's no way to easily change the existing option, since that's locked out once there is data for the field in the database.

Steps to reproduce

Not easily reproducible. You'd need a site built back before the new UI for field creation/management was put in place, with a field of type "Selection Field" with integer values and one of the values having a value of zero (0). You'd then need to upgrade to a current version of Drupal 11, then try to change one of that field's allowable values, or try adding a new allowable value.

Proposed resolution

If possible, change the validation test for the "Value" field to test for it simply being blank, rather than zero. If that's not possible, then just get rid of the test and only test to ensure that every Value field has a unique integer value. A single blank value would then be interpreted as the integer zero (0). More than one blank value would generate a warning that there are duplicate values that need to be corrected.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

iacwebdev created an issue.