Problem/Motivation
The plugin.manager.icon_extractor service uses Drupal\Core\Theme\Icon\IconExtractorInterface as its service alias. That is the interface for the actual plugins, though, not the class (or interface) used by the plugin manager.
Steps to reproduce
This leads to errors when attempting to auto-wire the plugin manager:
public function __construct(IconExtractorInterface $iconExtractorPluginManager)
works in terms of auto-wiring but then fails on the actual typehint.
Proposed resolution
Fix the service alias to be Drupal\Core\Theme\Icon\IconExtractorPluginManager.
Remaining tasks
User interface changes
-
Introduced terminology
-
API changes
The old (broken) service alias no longer exists.
Data model changes
-
Release notes snippet
Issue fork drupal-3572050
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3572050-plugin-manager-icon-extractor-alias
changes, plain diff MR !14673
Comments
Comment #3
tstoecklerCreated a quick MR. Since we generally don't have explicit test coverage of service aliases I don't think that's needed here. Also in my opinion no change record is needed for the removed (broken) alias, but happy to oblige on either of those things if that's deemed required.
Comment #4
smustgrave commentedGoing to mark. I agree not needing test coverage. I'm 50/50 about the CR.
Comment #5
longwaveYep no test required here, although perhaps AutowireTest could be improved to check that existing aliases actually match the interface they claim to? Followup material though.
Backported to 11.3.x as this is broken at the moment and the fix can only improve things there.
Committed and pushed e3514b44fb5 to main and d54dc3fde78 to 11.x and 5034f89a54d to 11.3.x. Thanks!
Comment #11
longwaveOpened #3578486: Check aliases match interfaces in AutowireTest