diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php index 1ad6fe1ad1..e40849cbcd 100644 --- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php +++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php @@ -58,15 +58,13 @@ public static function validateAllowedFormats(array &$element, FormStateInterfac */ public static function calculateDependencies(FieldDefinitionInterface $field_definition) { // Add explicitly allowed formats as config dependencies. + $format_dependencies = []; $dependencies = parent::calculateDependencies($field_definition); if (!is_null($field_definition->getSetting('allowed_formats'))) { $format_dependencies = array_map(function (string $format_id) { return 'filter.format.' . $format_id; }, $field_definition->getSetting('allowed_formats')); } - else { - $format_dependencies = []; - } $config = $dependencies['config'] ?? []; $dependencies['config'] = array_merge($config, $format_dependencies); return $dependencies;