Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save zanvidmar/29d793fd5270df731615b3fc5fa007f5 to your computer and use it in GitHub Desktop.

Select an option

Save zanvidmar/29d793fd5270df731615b3fc5fa007f5 to your computer and use it in GitHub Desktop.
Deprecated (moved to BB)
diff --git a/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
index 6619c58..9e1fe5b 100644
--- a/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
+++ b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
@@ -300,6 +300,10 @@ protected function buildSections(FieldableEntityInterface $entity) {
if ($storage) {
foreach ($storage->getSections() as $delta => $section) {
$build[$delta] = $section->toRenderArray($contexts);
+ $build[$delta]['#view_mode'] = $this->getOriginalMode();
+ $build[$delta]['#bundle'] = $this->getTargetBundle();
+ $build[$delta]['#entity_type'] = $this->getTargetEntityTypeId();
+ $build[$delta]['#entity_id'] = $entity->id();
}
}
// The render array is built based on decisions made by @SectionStorage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment