Snippets

Oleksiy Kalinichenko Custom fix for "Default text formats" based on https://www.drupal.org/node/1278886 for Drupal 8.6 and 8.7

Created by Oleksiy Kalinichenko

File 1278886.patch Added

  • Ignore whitespace
  • Hide word diff
+diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
+index e70fadacb1..1de5597a98 100644
+--- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
++++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
+@@ -49,7 +49,9 @@ public function applyDefaultValue($notify = TRUE) {
+    */
+   public function isEmpty() {
+     $value = $this->get('value')->getValue();
+-    return $value === NULL || $value === '';
++    $format = $this->get('format')->getValue();
++
++    return ($value === NULL || $value === '') && ($format === NULL || $format === '');
+   }
+ 
+   /**
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.