Problem/Motivation

While unflagging a node following error is thrown:

TypeError: Drupal\flag_lists\EventSubscriber\FlagForListSubscriber::flagListsEntityUnflagged(): Argument #1 ($flag_events) must be of type Symfony\Component\EventDispatcher\Event, Drupal\flag\Event\UnflaggingEvent given in Drupal\flag_lists\EventSubscriber\FlagForListSubscriber->flagListsEntityUnflagged() (line 57 of /app/public/modules/contrib/flag_lists/src/EventSubscriber/FlagForListSubscriber.php).

Steps to reproduce

Environment: Drupal 10

  • Flag a node
  • Try to unflag node

Proposed resolution

Change expected argument types to FlaggingEvent and UnflaggingEvent in corresponding methods.

Comments

jviitamaki created an issue. See original summary.

jviitamaki’s picture

StatusFileSize
new1.64 KB
sl27257’s picture

Assigned: Unassigned » sl27257
Status: Active » Needs review

Hi,

thanks for the report!

I am a sort of aware of this problem. It is mentioned in the release note for flag_lists 4.0.0-rc3 where it is listed as a dependency to the flag module. So if I understand this correctly it will break sooner or later and require a fix in the flag module.

But that said, your patch is is a great way to get away from the flag module dependency!

Thanks!

  • sl27257 committed 4c912e42 on 4.0.x authored by jviitamaki
    Issue #3395071 by jviitamaki: Unflagging event is getting wrong event
    
sl27257’s picture

Status: Needs review » Reviewed & tested by the community
sl27257’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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