Problem/Motivation

In #3265945: Deprecate plugins using annotations and plugin types not supporting attributes, a deprecation warning was added for plugins that don’t specify a plugin attribute.
However, the deprecation message uses __CLASS__ instead of static::class, so the message is always the same:

Not supporting attribute discovery in Drupal\Core\Plugin\DefaultPluginManager is deprecated in drupal:11.2.0 …

This makes it hard to find out which plugin types are actually affected.

Steps to reproduce

Have any plugin type installed that doesn’t support attribute discovery yet.

Proposed resolution

Change __CLASS__ to static::class to include the actually affected plugin manager class in the deprecation message.

Since the current code uses __CLASS__ instead of including the class name verbatim, I think this was the intended behavior, but the difference between __CLASS__ and static::class was not properly understood and the behavior was not properly tested.

Remaining tasks

  • Decide whether we want to make this change.
  • Implement an MR.
  • Review and merge.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Issue fork drupal-3539537

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

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Issue summary: View changes
Status: Active » Needs review

I opened an MR with the trivial code change.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

This greatly improves the ability to debug these errors.

  • catch committed 387e10a4 on 11.x
    Issue #3539537 by drunken monkey: Deprecation warning in...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

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

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

Maintainers, please credit people who helped resolve this issue.

  • catch committed caef5894 on 11.2.x
    Issue #3539537 by drunken monkey: Deprecation warning in...
catch’s picture

Version: 11.x-dev » 11.2.x-dev

Also cherry-picked to 11.2.x

Status: Fixed » Closed (fixed)

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