Loading core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php +15 −12 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public function onBuildRender(SectionComponentBuildRenderArrayEvent $event) { 'content' => $content, ]; if ($event->inPreview()) { if ($block instanceof PreviewFallbackInterface) { $preview_fallback_string = $block->getPreviewFallbackString(); } Loading @@ -134,6 +135,8 @@ public function onBuildRender(SectionComponentBuildRenderArrayEvent $event) { if ($is_content_empty && $is_placeholder_ready) { $build['content']['#markup'] = $this->t('Placeholder for the @preview_fallback', ['@preview_fallback' => $block->getPreviewFallbackString()]); } } $event->setBuild($build); } } Loading core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php +0 −6 Original line number Diff line number Diff line Loading @@ -117,9 +117,6 @@ public function testOnBuildRender($refinable_dependent_access) { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], ]; $expected_cache = $expected_build + [ Loading Loading @@ -192,9 +189,6 @@ public function testOnBuildRenderWithoutPreviewFallbackString($refinable_depende '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], ]; $expected_cache = $expected_build + [ Loading core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php +0 −6 Original line number Diff line number Diff line Loading @@ -110,9 +110,6 @@ public function testToRenderArray() { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], '#cache' => [ 'contexts' => [], 'tags' => [], Loading Loading @@ -252,9 +249,6 @@ public function testContextAwareBlock() { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], '#cache' => [ 'contexts' => [], 'tags' => [], Loading Loading
core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php +15 −12 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public function onBuildRender(SectionComponentBuildRenderArrayEvent $event) { 'content' => $content, ]; if ($event->inPreview()) { if ($block instanceof PreviewFallbackInterface) { $preview_fallback_string = $block->getPreviewFallbackString(); } Loading @@ -134,6 +135,8 @@ public function onBuildRender(SectionComponentBuildRenderArrayEvent $event) { if ($is_content_empty && $is_placeholder_ready) { $build['content']['#markup'] = $this->t('Placeholder for the @preview_fallback', ['@preview_fallback' => $block->getPreviewFallbackString()]); } } $event->setBuild($build); } } Loading
core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php +0 −6 Original line number Diff line number Diff line Loading @@ -117,9 +117,6 @@ public function testOnBuildRender($refinable_dependent_access) { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], ]; $expected_cache = $expected_build + [ Loading Loading @@ -192,9 +189,6 @@ public function testOnBuildRenderWithoutPreviewFallbackString($refinable_depende '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], ]; $expected_cache = $expected_build + [ Loading
core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php +0 −6 Original line number Diff line number Diff line Loading @@ -110,9 +110,6 @@ public function testToRenderArray() { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], '#cache' => [ 'contexts' => [], 'tags' => [], Loading Loading @@ -252,9 +249,6 @@ public function testContextAwareBlock() { '#base_plugin_id' => 'block_plugin_id', '#derivative_plugin_id' => NULL, 'content' => $block_content, '#attributes' => [ 'data-layout-content-preview-placeholder-label' => $placeholder_label, ], '#cache' => [ 'contexts' => [], 'tags' => [], Loading