Problem/Motivation

Drupal core now supports #3252386: Use PHP attributes instead of doctrine annotations. Per https://www.drupal.org/node/3395582 , Not providing an attribute class is deprecated in Drupal 11.2 and will no longer be supported in Drupal 12.

This module should provide PHP attribute support as soon as possible so that custom implementations can begin transitioning from Annotations to Attributes.

Since the minimum compatible version of Drupal core is already 10.2, the Doctrine annotation syntax can be removed.

Entity Usage should specify a future plan for removing the Annotations classes, at which point all custom implementations must be converted to Attributes. This should be part of a new minor version release, since implementers of entity_usage plugins will need to convert existing plugins from annotation to attribute syntax.

References

Remaining tasks

1. Register the plugin Attribute class.
1. Add Attribute notation to each EntityUsageTrack plugin instance.

User interface changes

None.

API changes

Initially, PHP Attributes are supported while PHP Annotations are deprecated. The module maintainers should specify a planned date when Annotations will be removed (possibly concurrent with providing Drupal 12 compatibility?)

Data model changes

None.

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

mark_fullmer created an issue. See original summary.

alexpott’s picture

Status: Active » Needs work

We need to merge in 8.x-2.x to get the pipeline fixes. What's the minimum 10.x version then for the module - we might need to update composer.json and entity_usage.info.yml

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

acbramley’s picture

Status: Needs work » Needs review

Pipeline's green, we can in theory remove annotation support since minimum supported version is 10.2. We would need to remove the deprecated plugin test that is missing a required parameter though. Maybe that's best done as part of a 2.1 release.

mark_fullmer’s picture

Issue summary: View changes
mark_fullmer’s picture

I heartily agree that removal of Annotation support should be deferred for a new minor version release of entity_usage, since custom implementers of entity_usage plugins (which our organization represents!) will need to convert their custom plugins' Annotation syntax to Attributes.

I merged the latest changes, and also converted two other plugin implementations from Annotation syntax to Attribute syntax in the latest commits. This looks good on my end.

alexpott’s picture

Version: 8.x-2.x-dev » 5.x-dev

Moving this on to the 5.x branch.

alexpott’s picture

We can merge to 5.x and 8.x-2.x and then remove annotation support in 5.x

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This looks great going to put it in 5.x and 8.x-2.x and then open a follow-up to remove the annotation from 5.x.

  • alexpott committed d31be365 on 5.x
    task: #3553074 Add support for PHP Attributes in EntityUsageTrack plugin...

  • alexpott committed 329e14e0 on 8.x-2.x
    task: #3553074 Add support for PHP Attributes in EntityUsageTrack plugin...
alexpott’s picture

Version: 5.x-dev » 8.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

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.