Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[EventDispatcher] After upgrading to 3.3.0 removeSubscriber() does not work any more. #22970

Copy link
Copy link
Closed
@Gemineye

Description

@Gemineye
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.3.0

In some commands I use this kind of functionality to disable the sending of Emails:
$this->getContainer()->get('event_dispatcher')->removeSubscriber($this->getContainer()->get('my_email_subscriber'));

And then I put it back:

$this->getContainer()->get('event_dispatcher')->addSubscriber($this->getContainer()->get('my_email_subscriber'));

After some debugging I found out that the EventDispatcher now holds closures to enhance LazyLoading in the $this->listeners array.
So the array_search check does not work anymore in function removeListener.

I'm not sure if this really is a bug or if there is a new way now to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.