Problem/Motivation

When you run a Functional test extending `BrowserTestBase` you can see there's an advice about the use of `@FieldWidget` annotation saying that it's deprecated

Steps to reproduce

1. Create a functional test extending `BrowserTestBase`
2. Create a test that uses inline_entity_form
3. Launch the test
4. You'll see the advice on the console `Using @FieldWidget annotation for plugin with ID inline_entity_form_simple is deprecated and is removed from drupal:13.0.0. Use a Drupal\Core\Field\Attribute\FieldWidget attribute instead. See https://www.drupal.org/node/3395575`

Proposed resolution

Replace the annotation `@FieldWidget` by attributes

Remaining tasks

Create a MR with the change

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

luismagr created an issue. See original summary.

luismagr’s picture

Status: Needs work » Needs review
luismagr’s picture

Title: Remove deprecation » Remove deprecation @FieldWidget
Issue summary: View changes
bluegeek9’s picture

This will make the minimum supported version 10.2.0

bluegeek9’s picture

Assigned: Unassigned » bluegeek9
bluegeek9’s picture

Assigned: bluegeek9 » Unassigned

I restored the annotation but kept the attributes

I also added unit and kernel tests.

dww’s picture

bluegeek9 changed the visibility of the branch 3.x to hidden.

dww’s picture

Wow, I opened the MR expecting a tiny diff, and instead found:

 8 files +2054 −0

🤯 What's happening? Is that all LLM-generated test code? If so, you need to disclose usage. Did you review any of it? Is any of it in scope with the stated change? If we have any existing coverage of the widget, this change should work or not and our current tests would notice.

I rebased from the latest 3.x, and left off that final commit. For the 3.x branch, we don't care about anything older than D11.3, so we can already remove the annotation entirely. Now the changes tab in the MR is viable:

2 files +22 −20

I don't know if we even want a 3.0.x MR that only adds the attribute and leaves the annotations. Not sure I care about deprecations there.

dww’s picture

Title: Remove deprecation @FieldWidget » Convert @FieldWidget annotation to FieldWidget attribute

  • dww committed 8e040cc6 on 3.x
    task: #3592475 Convert @FieldWidget annotation to FieldWidget attribute...
dww’s picture

Status: Needs review » Fixed

Merged to 3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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