Deprecation warning in DefaultPluginManager::__construct() is too unspecific

Created on 4 August 2025, 13 days ago

Problem/Motivation

In πŸ“Œ Triggering deprecations for plugins using annotations when core plugin type has been converted to attributes Needs work , 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

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

plugin system

Created by

πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024