Allowed values interface gives error when field in use

Created on 24 January 2024, almost 2 years ago
Updated 29 May 2024, over 1 year ago

Problem/Motivation

Drupal 10.2.2 now offers an attractive GUI interface for adding new allowed values to a field and removing ones that are not in use. Except that if you try to submit the form on a field with any existing values, you get an error saying that it cannot have its keys changed.

Steps to reproduce

Create a list field with one or more allowed values. Create or edit an entity with this field, entering a value for the field. Edit the field storage and attempt to add or remove an allowed value. You will see an error saying "Oops, something went wrong. Check your browser's developer console for more details." The developer console and the log will both say,

Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException: A list field 'field_fieldname' with existing data cannot have its keys changed. in options_field_storage_config_update_forbid() (line 116 of core/modules/options/options.module).

Proposed resolution

unknown

Remaining tasks

unknown

🐛 Bug report
Status

Closed: cannot reproduce

Version

11.0 🔥

Component
Field 

Last updated 2 months ago

Created by

🇺🇸United States BenStallings

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024