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.
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.
Change code of buildMultiple() function to not call parent's one in all cases, but only, if necessary.
Needs work
10.1 β¨
Last updated
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.