Unverified Commit a22c3c45 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3090174 by tim.plunkett, henriklarsson: Data attribute...

Issue #3090174 by tim.plunkett, henriklarsson: Data attribute 'layout-content-preview-placeholder-label' exists outside LB UI
parent bd584c57
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ public function onBuildRender(SectionComponentBuildRenderArrayEvent $event) {
        'content' => $content,
      ];

      if ($event->inPreview()) {
        if ($block instanceof PreviewFallbackInterface) {
          $preview_fallback_string = $block->getPreviewFallbackString();
        }
@@ -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);
    }
  }
+0 −6
Original line number Diff line number Diff line
@@ -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 + [
@@ -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 + [
+0 −6
Original line number Diff line number Diff line
@@ -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' => [],
@@ -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' => [],