[policy no patch] Make it possible to mark plugins as deprecated

Created on 10 November 2017, over 6 years ago
Updated 9 January 2024, 5 months ago

Problem/Motivation

In #2916740: Add generic entity actions β†’ we want to mark some node and comment action plugins as deprecated and replace them with generic entity actions. Since #2870194: Ensure that process-isolated tests can use Symfony's PHPunit bridge to catch usages of deprecated code β†’ landed, it's no longer possible to mark the complete action plugin class as deprecated, because during tests, the plugin discovery will still call this class and trigger the deprecation error.

For example the NodeActionsConfigurationTest test opens up the UI and as part of that the deprecated plugin will be initialized.

So we need an other solution to mark plugins as deprecated.

Proposed resolution

I discussed this shortly with berdir and alexpott on IRC and a first proposal is to add a "deprecated" key into the plugin annotation and call trigger_error during Drupal\Component\Plugin\PluginManagerBase::createInstance()

Remaining tasks

Discuss
Implement
Review
Commit
Update https://www.drupal.org/core/deprecation β†’

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated 1 day ago

Created by

πŸ‡©πŸ‡ͺGermany chr.fritsch πŸ‡©πŸ‡ͺπŸ‡ͺπŸ‡ΊπŸŒ

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024