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
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:
- 3539537-unspecific-deprecation-warning
changes, plain diff MR !12905
Comments
Comment #3
drunken monkeyI opened an MR with the trivial code change.
Comment #4
borisson_This greatly improves the ability to debug these errors.
Comment #6
catchCommitted/pushed to 11.x, thanks!
Comment #9
catchAlso cherry-picked to 11.2.x