Allow object-based plugin definitions to be processed in DefaultPluginManager::findDefinitions()

Created on 14 October 2016, almost 8 years ago
Updated 12 September 2023, 12 months ago

Problem/Motivation

\Drupal\Core\Plugin\DefaultPluginManager::findDefinitions() checks for a 'provider' key in the plugin definition array, and removes the definition if the provider does not exist.

However not all plugin definitions are arrays. It attempts to handle this by casting the object to an array, but that only works if there is a public $provider; property in the definition class, which is not ideal.

Proposed resolution

Expand \Drupal\Component\Plugin\Definition\PluginDefinitionInterface.
Previously discussed was adding a new interface, and deprecating PDI.
However, multiple issues want to expand PDI, we can't just introduce a single new interface that replaces it. We'd end up with a confusing circular dependency of which interfaces to use when and which would be deprecated.

@catch cited that problem, and https://www.drupal.org/core/d8-bc-policy β†’ , to suggest that we just expand PDI directly

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

8.3 ⚰️

Component
PluginΒ  β†’

Last updated about 15 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

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.71.5 2024