Combine field storage and field instance forms

Created on 10 March 2023, almost 2 years ago
Updated 17 November 2023, about 1 year ago

Problem/Motivation

Based on a usability study conducted earlier this year 📌 Field UI 2023 User Research Fixed , users across all skill levels have hard time understanding the difference between the different steps in the field creation process. Even experienced users reported that they don't remember on which form the configuration they are looking for exists, and they usually find the configuration by trial and error. There are specific examples where having the two forms separated create usability issues like 📌 field config form for an entity reference field doesn't tell you what entity type it references Closed: duplicate .

Many users also mentioned being dissatisfied with the number of steps it takes to create a content model.

Proposed resolution

Make the field editing and creation process easier and faster by combining the field storage and field instance forms. This is done by rendering the field storage form to a details element as a subform. The details element contains an explanation that the storage settings apply across all uses of that field.

Remaining tasks

User interface changes

API changes

  1. \Drupal\field_ui\Form\FieldStorageConfigEditForm is rendered as a subform inside \Drupal\field_ui\Form\FieldConfigEditForm. We are manually triggering alter hooks for the subform for BC.
  2. There's an API addition to \Drupal\Core\Form\SubformState to store subform form object. This is needed for \Drupal\field_ui\Form\FieldStorageConfigEditForm rendered plugin forms and alters to have access to the subform form object.
  3. \Drupal\field\FieldConfigStorage needs to be updated while changes are being made in the field config edit form to make sure that the field config edit form is rendered with up-to-date field storage configuration. This means that modules can no longer rely solely on hook_field_storage_config_update to update the field config entity when changes to field storage is being made.
  4. \Drupal\Core\Field\FieldConfigBase needs to serialize fieldStorage property because in the Field UI use case, the field storage entity cannot be regenerated.

Data model changes

None

Release notes snippet

The \Drupal\field_ui\Form\FieldStorageConfigEditForm is now rendered as a subform within \Drupal\field_ui\Form\FieldConfigEditForm. This adjustment streamlines the configuration process, making it more intuitive and user-friendly.

Action Required for Developers:

Updates to Field Configuration Handling: We've made changes to how field configuration is handled during edits in the field configuration form. Previously, hook_field_storage_config_update was sufficient to update field configuration when changes occurred in field storage. However, with this structural change, additional steps are required.

  • Developers relying on hook_field_storage_config_update should now consider implementing additional logic to ensure that field configuration remains synchronized with field storage configuration. This is particularly important when making field storage changes within \Drupal\field_ui\Form\FieldConfigEditForm.
  • Specifically, \Drupal\field\FieldConfigStorage should be updated during changes made in the field config edit form to ensure that the field config edit form always reflects the most up-to-date field storage configuration.
📌 Task
Status

Fixed

Version

11.0 🔥

Component
Field UI 

Last updated 4 days ago

Created by

🇺🇸United States bnjmnm Ann Arbor, MI

Live updates comments and jobs are added and updated live.
  • Field UX

    Usability improvements related to the Field UI

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