Problem/Motivation

flag.services.yml includes the following line:

flag:
    class: Drupal\flag\FlagService
    arguments: ['@plugin.manager.flag.flagtype', '@event_dispatcher', '@entity.query', '@current_user', '@entity.manager']

FlagService takes the entity type manager, not the entity manager as the last argument. The wrong service is being injected.

Proposed resolution

Change @entity.manager to @entity_type.manager.

Remaining tasks

Create patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

socketwench created an issue. See original summary.

socketwench’s picture

Status: Active » Needs review
FileSize
620 bytes
martin107’s picture

Status: Needs review » Reviewed & tested by the community

I guess that little nasty crept in while the deprecated entity_manager was being swapped out....
A little time bomb just biding its time

Good catch

Berdir’s picture

Looks fine.

It's a pretty slow time bomb though, since EntityManager will not be removed before Drupal 9 and who knows that will happen then ;)

  • socketwench committed 2862d2d on 8.x-4.x
    Issue #2708669 by socketwench: Fixed incorrect entity type service tag...
socketwench’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

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