ComponentPluginManager decorator should call decorated service instead of parent

Created on 17 October 2025, 14 days ago

Problem/Motivation

Canvas decorates plugin.manager.sdc:
Drupal\canvas\Plugin\ComponentPluginManager:
decorates: plugin.manager.sdc
parent: Drupal\Core\Theme\ComponentPluginManager
arguments: ['@entity_type.manager', '@Drupal\canvas\ComponentIncompatibilityReasonRepository']
tags:
- { name: canvas.component_source }

But the implementation may be incorrect: https://git.drupalcode.org/project/canvas/-/blob/1.x/src/Plugin/Componen...

It extends Drupal\Core\Theme\ComponentPluginManager and calls parent:: methods instead of using the decorated service:

parent::processDefinition($definition, $plugin_id);

Proposal:

$this->decorated->processDefinition($definition, $plugin_id);

This bypasses Symfony's & Drupal’s service decoration mechanism, so additional decorators or alternative implementations of plugin.manager.sdc are ignored.

Proposed Resolution

  • Inject the decorated component_plugin_manager service via the constructor.
  • Replace all parent:: calls with calls to $this->decorated.

For your information, a similar issue has been created for UI Patterns (still drafty): ComponentPluginManager decorator incorrectly calls parent instead of decorated service Needs review

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

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.

No activities found.

Production build 0.71.5 2024