Skip to content

[EventDispatcher] TraceableEventDispatcher resets event listener priorities #17459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

c960657
Copy link
Contributor

@c960657 c960657 commented Jan 20, 2016

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15550
License MIT
Doc PR -

$tdispatcher->addListener('foo', $listener1 = function () use (&$called) { $called[] = 'foo1'; });
$tdispatcher->addListener('foo', $listener2 = function () use (&$called) { $called[] = 'foo2'; });
$tdispatcher->addListener('foo', $listener1 = function () use (&$called) { $called[] = 'foo1'; }, 10);
$tdispatcher->addListener('foo', $listener2 = function () use (&$called) { $called[] = 'foo2'; }, 20);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the $listener1 and $listener2 variables are actually unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@stof
Copy link
Member

stof commented Jan 20, 2016

@c960657 what is the lower Symfony version where this patch can be applied ? The bug seems to impact 2.7+

@c960657 c960657 force-pushed the eventdispatcher-priority branch from 683169b to fc40005 Compare January 20, 2016 17:19
@c960657
Copy link
Contributor Author

c960657 commented Jan 20, 2016

@stof The patch applies cleanly to 2.7+. The bug seems to have always been there, even back in 2.3 when TraceableEventDispatcher belonged to HttpKernel.

@c960657 c960657 force-pushed the eventdispatcher-priority branch from fc40005 to 9d553b7 Compare January 21, 2016 07:08
@fabpot
Copy link
Member

fabpot commented Jan 21, 2016

@c960657 If the bug is present in 2.3, we need to fix it there first. Can you work on creating a PR for 2.3?

@c960657
Copy link
Contributor Author

c960657 commented Jan 21, 2016

I have made separate pull requests for the 2.3 (#17482) and 2.7 (#17483) branches.

The patch for master applies cleanly to the 2.7 branch (i.e. git does not complain), but it would break BC, because EventDispatcherInterface::getListenerPriority() is not defined prior to 3.0.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

@c960657 Sorry for that but I've closed the other PRs as the listener priority is only available as of 2.8, so I'm going to merge this one on 2.8.

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

Thank you @c960657.

fabpot added a commit that referenced this pull request Jan 25, 2016
…stener priorities (c960657)

This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #17459).

Discussion
----------

[EventDispatcher] TraceableEventDispatcher resets event listener priorities

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15550
| License       | MIT
| Doc PR        | -

Commits
-------

233e5b8 [EventDispatcher] TraceableEventDispatcher resets listener priorities
@fabpot fabpot closed this Jan 25, 2016
@fabpot fabpot mentioned this pull request Feb 3, 2016
@fabpot fabpot mentioned this pull request Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants