Convert EntityReferenceSelection plugin discovery to attributes

Created on 13 February 2024, 4 months ago
Updated 24 March 2024, 3 months ago

Problem/Motivation

In 📌 Use PHP attributes instead of doctrine annotations Fixed we added support for attribute based plugin discovery.
As part of that issue we converted block and action plugins.

This issue is to convert \Drupal\Core\Entity\Annotation\EntityReferenceSelection plugins to use Attributes.

Proposed resolution

  1. Add a class to represent the new Attribute - Example
  2. Update the plugin manager constructor to include both the attribute and annotation class names - example
  3. Convert all plugins that use the annotation to use the new attribute - example

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
Entity 

Last updated about 5 hours ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @larowlan
  • First commit to issue fork.
  • Status changed to Needs work 4 months ago
  • 🇳🇿New Zealand quietone New Zealand

    This will fail with phpstan errors. One is about the deliberately broken plugin and another is for the missing '$deriver' property.

  • First commit to issue fork.
  • Pipeline finished with Failed
    4 months ago
    Total: 203s
    #107662
  • Status changed to Needs review 4 months ago
  • Pipeline finished with Failed
    4 months ago
    Total: 208s
    #107671
  • Pipeline finished with Failed
    4 months ago
    #107674
  • Status changed to Needs work 4 months ago
  • 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
  • Pipeline finished with Running
    4 months ago
    #107888
  • Status changed to Needs review 4 months ago
  • 🇷🇺Russia sorlov

    fixed phpstan issues

  • Pipeline finished with Failed
    4 months ago
    Total: 541s
    #107905
  • Status changed to Needs work 4 months ago
  • 🇺🇸United States smustgrave

    Appears to have several test failures.

  • Pipeline finished with Failed
    4 months ago
    Total: 486s
    #111328
  • Pipeline finished with Canceled
    4 months ago
    Total: 26s
    #111592
  • Pipeline finished with Failed
    4 months ago
    Total: 484s
    #111594
  • Pipeline finished with Failed
    4 months ago
    Total: 487s
    #112000
  • Pipeline finished with Success
    4 months ago
    Total: 492s
    #112775
  • Status changed to Needs review 4 months ago
  • Status changed to RTBC 4 months ago
  • 🇺🇸United States smustgrave

    Appears all instances and feedback has been addressed.

  • Status changed to Needs work 4 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Added some comments to the MR>

  • Pipeline finished with Failed
    4 months ago
    Total: 171s
    #114556
  • Pipeline finished with Success
    4 months ago
    Total: 523s
    #114572
  • Status changed to Needs review 4 months ago
  • Status changed to RTBC 4 months ago
  • 🇺🇸United States smustgrave

    Suggestions appear to added

  • Pipeline finished with Canceled
    4 months ago
    Total: 11s
    #114814
  • Pipeline finished with Failed
    4 months ago
    Total: 167s
    #114816
  • Status changed to Needs review 4 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    I had to make some changes to the MR in order to benefit from attributes. Weight and group are now required. Annotations was quite loose so we couldn't enforce this properly there but now we can. I don't think that the broken handler should cause to make them optional - given how the broken handler works - see \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager. We can provide some defaults in that plugin that are going to be ignored.

  • Pipeline finished with Failed
    4 months ago
    #114836
  • Pipeline finished with Success
    4 months ago
    Total: 565s
    #114845
  • Status changed to RTBC 4 months ago
  • 🇺🇸United States smustgrave

    Update using weight and group didn't break anything.

    • larowlan committed 2061b8fb on 10.3.x
      Issue #3420982 by sorlov, alexpott: Convert EntityReferenceSelection...
    • larowlan committed b4a9a825 on 11.x
      Issue #3420982 by sorlov, alexpott: Convert EntityReferenceSelection...
  • Status changed to Fixed 4 months ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Committed to 11.x and backported to 10.3.x

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

Production build 0.69.0 2024