diff -u b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php --- b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php +++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php @@ -36,9 +36,11 @@ $element['#format'] = $items[$delta]->format; $element['#base_type'] = $main_widget['value']['#type']; - $allowed_formats = array_filter($this->getFieldSetting('allowed_formats')); - if (!empty($allowed_formats) && !$this->isDefaultValueWidget($form_state)) { - $element['#allowed_formats'] = $allowed_formats; + if (is_array($this->getFieldSetting('allowed_formats'))) { + $allowed_formats = array_filter($this->getFieldSetting('allowed_formats')); + if (!empty($allowed_formats) && !$this->isDefaultValueWidget($form_state)) { + $element['#allowed_formats'] = $allowed_formats; + } } return $element; diff -u b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php --- b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php +++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php @@ -36,9 +36,11 @@ $element['#format'] = isset($items[$delta]->format) ? $items[$delta]->format : NULL; $element['#base_type'] = $main_widget['value']['#type']; - $allowed_formats = array_filter($this->getFieldSetting('allowed_formats')); - if (!empty($allowed_formats) && !$this->isDefaultValueWidget($form_state)) { - $element['#allowed_formats'] = $allowed_formats; + if (is_array($this->getFieldSetting('allowed_formats'))) { + $allowed_formats = array_filter($this->getFieldSetting('allowed_formats')); + if (!empty($allowed_formats) && !$this->isDefaultValueWidget($form_state)) { + $element['#allowed_formats'] = $allowed_formats; + } } return $element;