I can no longer save changes to the layout after any kind of form has been added to the layout.
Steps to reproduce:
1. Enable layout builder on a content type, then open layout builder.
2. Add 'Search Form' block to a section
3. Save the layout
4. Re-open the layout builder, and make some change (e.g. reorder blocks)
5. Attempt to save the layout
The page refreshes, but still shows unsaved changes. At this point, it is no longer possible to save the layout until the search form is removed.
Since the layout_builder
element is not a form element, and all the layout-related values are managed through the temp store, the layout_builder
element can be placed outside the form element, preventing nested <form>
tags
layout_builder
render elements in the layout builder defaults and overrides forms, save the list of array parents to a property ('#layout_builder_element_keys'
) on the top-level $form
element.controller.entity_form
controller service. getContentResult()
method does not have the '#layout_builder_element_keys'
property, return the form render array as is.'#layout_builder_element_keys'
property, then use the property to extract the layout builder element from the form render array and move into a separate render array. Return a render array that has the form and the layout builder element array as sibling child elements.N/A
Layout Builder UI will no longer break when rendering forms
N/A
N/A
Fixed
8.9 ⚰️
layout_builder.module
Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.