TypeError: Drupal\Core\Field\FieldTypeCategory::getDescription() Return value must be of type Drupal\Core\StringTranslation\TranslatableMarkup

Created on 8 January 2024, 12 months ago
Updated 6 February 2024, 11 months ago

Problem/Motivation

Going to add a field to a content type with a DOI field produces the following error:

TypeError: Drupal\Core\Field\FieldTypeCategory::getDescription(): Return value must be of type Drupal\Core\StringTranslation\TranslatableMarkup, string returned in Drupal\Core\Field\FieldTypeCategory->getDescription()

This appears to be because there is no description in the annotation of DoiFieldItem.

See https://www.drupal.org/project/drupal/issues/3409413 🐛 Error TypeError: Drupal\Core\Field\FieldTypeCategory::getDescription() if a FieldType has 'description' missing in its annotation RTBC

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom Leo Pitt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024