Allow to insert rows in EntityDisplayFormBase

Created on 25 September 2023, 12 months ago

See also 📌 Make regions and fields pluggable or alterable in EntityDisplayFormBase Active

Problem/Motivation

In EntityDisplayFormBase, the table rows are made up from fields and extra fields found in the target entity.
Both of these exist per entity bundle, not per view mode.

Modules like field_group, that want to insert custom rows into the list, have to do acrobatics with hook_form_alter(), where they have to deal with the implementation details of the field_ui form.

The same problem would occur for a hypothetical module that wants to insert separators or other custom items into a view mode or form mode.

Steps to reproduce

Proposed resolution

Provide an API for modules to insert items into a display mode, without extending the form class.
These items can be groups or "leaf" items.

TBD:
One question is whether we can insert items dynamically, without saving anything, based on the form state.
E.g. if a field group module would provide a button "Add group", can we add the group with ajax, without saving the display mode?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component
Field UI 

Last updated 5 days ago

Created by

🇩🇪Germany donquixote

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024