[PP-1] Investigate alternative approaches to moving fields in FieldLayoutBuilder::buildView()

Created on 24 January 2017, over 8 years ago
Updated 16 May 2025, 3 days ago

Problem/Motivation

#2796173: Add experimental Field Layout module to allow entity view/form modes to switch between layouts β†’ allows for rearranging fields on entity form and entity view.
Entity forms use #group, which allows the array structure to remain unchanged, while rendering them into the regions.

That is only available to forms, not general render arrays.

Because of this, Entity view directly alters the array structure.
This increases the chances of contrib or custom code later trying to access the original location, resulting in broken functionality and possibly PHP notices.

Proposed resolution

The most straight-forward and robust solution would be to expand #group to work for all render arrays, which has an existing issue:
πŸ“Œ Make #group FAPI / render feature work on all form/render #types out of the box Needs work

Should that prove too complex, consider trying something specific to entity rendering, or something on the preprocess level.

Or, this could be decided as something not worth fixing.

Remaining tasks

Decide what to do:

  1. Postpone on generic #group issue, πŸ“Œ Make #group FAPI / render feature work on all form/render #types out of the box Needs work
  2. Develop new approach
  3. Close (won't fix)

User interface changes

N/A

API changes

TBD

Data model changes

N/A

πŸ“Œ Task
Status

Postponed

Version

11.0 πŸ”₯

Component

field_layout.module

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

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