Deprecate Drupal\Component\Plugin\PluginBase::isConfigurable()

Created on 6 July 2024, 2 months ago
Updated 31 July 2024, about 1 month ago

Problem/Motivation

In #2946122: Deprecate ConfigurablePluginInterface and replace with an interface that doesn't extend DependentPluginInterface β†’ We added an isConfigurable() method to the PluginBase class as a helper while we were converting things from ConfigurablePluginInterface to ConfigurableInterface, along with a static PluginHelper class to do the same thing. Since ConfigurablePluginInterface is long dead now, all this method does is an instanceOf check against ConfigurableInterface.

The method on the base class is not part of any interface, meaning if core actually used this to check if a plugin was configurable, it would break tests trying to use mocks or prophecies based on plugin interfaces (which is why the static helper was introduced there as well). Fortunately core does not use this.

Looking back at 2946122, I'm not quite sure why we even included it. I'm wondering if it should have been removed when we decided to go with the static helper, and doing so was just missed (by me... :-( ). We deprecated the static helper in 10.1 ( πŸ“Œ Deprecate PluginHelper::isConfigurable() Fixed ) and removed it from Drupal 11. We should deprecate this method and remove it from D12 in favor of having any calling code just do an `instanceof ConfigurableInterface` check

Steps to reproduce

Proposed resolution

Deprecate PluginBase->isConfigurable in D11.1 and remove from D12.0

Remaining tasks

Review and commit

User interface changes

API changes

PluginBase->isConfigurable() is deprecated

Data model changes

Release notes snippet

\Drupal\Component\Plugin\PluginBase->isConfigurable() is deprecated. Use instanceof to check if a plugin implements ConfigurableInterface instead.

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated about 14 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mikelutz Michigan, USA

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