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/KeyValueItem.php
/**
* Plugin implementation of the 'key_value' field type.
*
* @FieldType(
* id = "key_value",
* label = @Translation("Key / Value (plain)"),
* description = @Translation("This field stores key value pairs."),
* category = @Translation("Key / Value"),
* default_widget = "key_value_textfield",
* default_formatter = "key_value",
* column_groups = {
* "key" = {
* "label" = @Translation("Key"),
* "translatable" = TRUE,
* },
* "value" = {
* "label" = @Translation("Value"),
* "translatable" = TRUE,
* },
* "description" = {
* "label" = @Translation("Description"),
* "translatable" = TRUE,
* },
* },
* )
*/
Check the following file: src/Plugin/Field/FieldType/KeyValueLongItem.php
/**
* Plugin implementation of the 'key_value' field type.
*
* @FieldType(
* id = "key_value_long",
* label = @Translation("Key / Value (long)"),
* description = @Translation("This field stores key value pairs."),
* category = @Translation("Key / Value"),
* default_widget = "key_value_textarea",
* default_formatter = "key_value",
* column_groups = {
* "key" = {
* "label" = @Translation("Key"),
* "translatable" = TRUE,
* },
* "value" = {
* "label" = @Translation("Value"),
* "translatable" = TRUE,
* },
* "description" = {
* "label" = @Translation("Description"),
* "translatable" = TRUE,
* },
* },
* )
*/
Proposed resolution
Fix it according to
https://www.drupal.org/node/3375748 →
Remaining tasks
User interface changes
API changes
Data model changes