FieldItemBase category cannot be translatable

Created on 19 February 2025, 4 months ago

Problem/Motivation

TypeError: Cannot access offset of type Drupal\Core\StringTranslation\TranslatableMarkup in isset or empty in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 45 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Steps to reproduce

Drupal 11.1.2 & questions_answers 1.14

- just go add a new field to content type
- admin/structure/types/manage//fields/add-field

Proposed resolution

 * @FieldType(
 *   id = "questions_answers",
 *   label = @Translation("Questions and Answers"),
 *   module = "questions_answers",
*   category = @Translation("Questions and Answers"),

to

 * @FieldType(
 *   id = "questions_answers",
 *   label = @Translation("Questions and Answers"),
 *   module = "questions_answers",
 *   category = "Questions and Answers",
🐛 Bug report
Status

Active

Version

1.14

Component

Code

Created by

🇫🇮Finland tvalimaa

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