Layout Builder entity view display buildMultiple() function always calls parent's one

Created on 26 August 2020, almost 5 years ago
Updated 9 February 2023, over 2 years ago

Problem/Motivation

Let's say we have CT with several fields. These fields are shown. Then on display settings we enable Layout Builder and manage display via its functionality. But formatters for our fields are executed anyway, because we haven't moved our fields to Disabled section. Because buildMultiple() function calls parent's one and then generates sections. Then it removes fields from build list, if sections are generated. If we have many fields, this results into performance hit, because first we build all enabled fields and then, in case layout builder is used, we remove these fields. Of course, this problem can be solved by disabling layout builder, moving all fields to Disabled section, save configuration, then enable layout builder again. But this is not user friendly and content manager can easily miss this step.

Steps to reproduce

Create CT and add some fields. Make sure these fields are enabled in default display. Check, if Layout builder is enabled and go to display settings. Check option for using layout builder and save configuration.

Proposed resolution

Change code of buildMultiple() function to not call parent's one in all cases, but only, if necessary.

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
Layout builderΒ  β†’

Last updated 1 day ago

Created by

πŸ‡·πŸ‡ΊRussia ilya.no

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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