diff --git a/src/Element/LayoutParagraphsBuilder.php b/src/Element/LayoutParagraphsBuilder.php index 61fae939b0545913a5014c9b428092daeaa1f968..0c3a3b50c85c9a8d04aabac3366ba7a1d208c45e 100644 --- a/src/Element/LayoutParagraphsBuilder.php +++ b/src/Element/LayoutParagraphsBuilder.php @@ -240,6 +240,7 @@ class LayoutParagraphsBuilder extends RenderElement implements ContainerFactoryP */ protected function buildComponent(LayoutParagraphsComponent $component, $preview_view_mode = 'default') { $entity = $component->getEntity(); + $entity->_layoutParagraphsBuilder = TRUE; $view_builder = $this->entityTypeManager->getViewBuilder($entity->getEntityTypeId()); $build = $view_builder->view($entity, $preview_view_mode, $entity->language()->getId()); $build['#post_render'] = [ diff --git a/src/LayoutParagraphsLayout.php b/src/LayoutParagraphsLayout.php index 820b89a0c27804c49677776610304ae63f1c909c..30fa97f6025bca60c487176bb3b65f0479d1bbde 100644 --- a/src/LayoutParagraphsLayout.php +++ b/src/LayoutParagraphsLayout.php @@ -167,6 +167,7 @@ class LayoutParagraphsLayout implements ThirdPartySettingsInterface { foreach ($paragraphs_reference_field as $key => $field_item) { if ($field_item->entity) { $paragraphs_reference_field[$key]->entity->_referringItem = $field_item; + $paragraphs_reference_field[$key]->entity->_layoutParagraphsLayout = $this; } } $this->paragraphsReferenceField = $paragraphs_reference_field;