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

Command icon 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:

Comments

tstoeckler created an issue. See original summary.

tstoeckler’s picture

Status: Active » Needs review

Created 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.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Going to mark. I agree not needing test coverage. I'm 50/50 about the CR.

longwave’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Yep 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!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • longwave committed 5034f89a on 11.3.x
    fix: #3572050 plugin.manager.icon_extractor has incorrect service alias...

  • longwave committed d54dc3fd on 11.x
    fix: #3572050 plugin.manager.icon_extractor has incorrect service alias...

  • longwave committed e3514b44 on main
    fix: #3572050 plugin.manager.icon_extractor has incorrect service alias...
longwave’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.