[Drupal 10.2] Using a translatable string as a category for field type is deprecated

Created on 29 February 2024, 9 months ago
Updated 19 April 2024, 7 months ago

Problem/Motivation

With Drupal 10.2, I found this deprecation message in logs:

Using a translatable string as a category for field type is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3364271

Steps to reproduce

Check the following file: src/Plugin/Field/FieldType/WebformEntityReferenceItem.php

/**
 * Defines the 'webform_entity_reference' entity field type.
 *
 * Extends EntityReferenceItem and only support targeting webform entities.
 *
 * @FieldType(
 *   id = "webform",
 *   label = @Translation("Webform"),
 *   description = @Translation("A webform containing default submission values."),
 *   category = @Translation("Reference"),
 *   default_widget = "webform_entity_reference_select",
 *   default_formatter = "webform_entity_reference_entity_view",
 *   list_class = "\Drupal\webform\Plugin\Field\FieldType\WebformEntityReferenceFieldItemList",
 * )
 */

Proposed resolution

Fix it according to https://www.drupal.org/node/3375748

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇦🇺Australia paulabg

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