Skip to content
Snippets Groups Projects
Commit 8b93a527 authored by Mikael Meulle's avatar Mikael Meulle Committed by Pierre Dureau
Browse files

Issue #3502069 by just_like_good_vibes, christian.wiedemann, pdureau,...

Issue #3502069 by just_like_good_vibes, christian.wiedemann, pdureau, grimreaper: Duplicate blocks when nested ComponentLayout with Layout Builder
parent f1d2c273
No related branches found
No related tags found
1 merge request!331Issue #3502069 by pdureau, grimreaper, just_like_good_vibes: Duplicate blocks when nested ComponentLayout with Layout Builder
Pipeline #406331 passed
......@@ -132,12 +132,11 @@ class ComponentLayout extends LayoutDefault implements ContainerFactoryPluginInt
continue;
}
$build['#slots'][$region_name] = $regions[$region_name];
// For layout builder we need to pass slots also
// direct to the build array. They are needed to generate contextual
// links and other surrounding markup.
// This makes field layout forms empty.
// Not sure how to handle this. Should we support field_layout?
$build[$region_name] = $regions[$region_name];
// Add a reference from slots to regions
// Additional markup and contextual links are added
// by layout consumers.
// @see Drupal\layout_builder\Element\LayoutBuilder::buildAddSectionLink
$build[$region_name] = &$build['#slots'][$region_name];
}
return $build;
}
......
......@@ -105,6 +105,9 @@ class LayoutBuilderRenderTest extends UiPatternsFunctionalTestBase {
$page->clickLink('Add block');
$page->clickLink('Text (formatted)');
$page->pressButton('Add block');
// Check if layout specific classes are added.
$assert_session->elementExists('css', 'div[data-layout-block-uuid]');
$page->pressButton('Save layout');
$this->drupalGet('node/' . $node->id());
$assert_session->elementExists('css', '.ui-patterns-test-component');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment