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

Issue fork webform-3424501

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

paulabg created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new838 bytes

@paulabg , I have fixed the issue and created patch.

Status: Needs review » Needs work

The last submitted patch, 3: webform-3424501.patch, failed testing. View results

mitrpaka made their first commit to this issue’s fork.

mitrpaka’s picture

Status: Needs work » Needs review
StatusFileSize
new1.84 KB
new1.74 KB

Added a backwards compatibility layer for Drupal 10.1 and previous versions as Webform 6.2.x works with Drupal: ^9.4 || ^10.

jrockowitz’s picture

This type of issue will most likely be automatically fixed by Drupal Rector

I am wrong about this being automated.

paulabg’s picture

@abhishek_gupta1 I created before this MR: https://git.drupalcode.org/project/webform/-/merge_requests/412

jrockowitz’s picture

Status: Needs review » Needs work

Could we please use the same version detection logic used through out the module.

// @todo Remove once Drupal 10.2.x is only supported.
if (floatval(\Drupal::VERSION) < 10.2) {
mitrpaka’s picture

Status: Needs work » Needs review
StatusFileSize
new1.74 KB
new590 bytes
jrockowitz’s picture

Status: Needs review » Fixed

  • jrockowitz committed 9303e33e on 6.2.x authored by mitrpaka
    Issue #3424501 by mitrpaka, paulabg, abhishek_gupta1, jrockowitz: [...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.