Commit 63e7b0ae authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Issue #3059129 by Anybody, tim.plunkett: Incompatible with layout builder - no output displayed

parent 79a50943
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\markup\Field;

use Drupal\Core\Field\FieldItemList;

/**
 * Defines a item list class for markup fields.
 *
 * @internal
 *   Plugin classes are internal.
 *
 * @see \Drupal\markup\Plugin\Field\FieldType\MarkupItem
 */
class MarkupItemList extends FieldItemList {

  /**
   * {@inheritdoc}
   */
  public function isEmpty() {
    $value = $this->getFieldDefinition()->getSetting('markup')['value'];
    return $value === NULL || $value === '';
  }

}
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ use Drupal\Core\TypedData\DataDefinition;
 *   category = @Translation("General"),
 *   default_widget = "markup",
 *   default_formatter = "markup",
 *   list_class = "\Drupal\markup\Field\MarkupItemList",
 * )
 */
class MarkupItem extends FieldItemBase {
@@ -81,4 +82,12 @@ class MarkupItem extends FieldItemBase {
    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public function isEmpty() {
    $value = $this->fieldDefinition->getSetting('markup')['value'];
    return $value === NULL || $value === '';
  }

}