Skip to content

Use LegacyEventDispatcherProxy for Symfony 4.3 #463

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

Merged
merged 3 commits into from
Nov 6, 2019

Conversation

XWB
Copy link
Member

@XWB XWB commented Nov 5, 2019

This should fix the following deprecation message:

User Deprecated: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.

@XWB
Copy link
Member Author

XWB commented Nov 5, 2019

It seems Travis fails due to an unrelated error:

Undefined index: trace_level

@dbu
Copy link
Contributor

dbu commented Nov 6, 2019

weird, that was a bug in symfony that i thought i fixed already once: symfony/symfony#32802

@dbu
Copy link
Contributor

dbu commented Nov 6, 2019

do you have time to debug that one locally?

looking at https://github.com/symfony/symfony/blob/v4.3.6/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L97 i can't see how this could ever happen with v4.3.6 of symfony/http-kernel so we would have to debug if the kernel somehow does not get instantiated properly or some assumption about the options is wrong.

btw looking at my "fix" again, i notice that trace_level already was initialized in the defaults and my change was pointless, just complicating the code a bit.

@dbu
Copy link
Contributor

dbu commented Nov 6, 2019

dug around the code a bit, i think the problem is with

->getMockBuilder($this->getCacheClass())
->setMethods($mockedMethods)
->disableOriginalConstructor()

we create a partial mock. dangerous territory 😱
i guess we should change getHttpCachePartialMock to always mock the addTraces method to avoid the issue.

@XWB
Copy link
Member Author

XWB commented Nov 6, 2019

@dbu Nice find. Disabling the original constructor is a classic pitfall :) I just pushed another commit that fixes the unit tests.

There is still one test failing but seems to be a totally different issue:

Exception occurred:
File "/usr/lib/python2.7/dist-packages/sphinx/locale/init.py", line 191, in _
return translators['sphinx'].ugettext(message)
KeyError: 'sphinx'

@dbu dbu merged commit 99e856b into FriendsOfSymfony:master Nov 6, 2019
@dbu
Copy link
Contributor

dbu commented Nov 6, 2019

thank you!

yeah the sphinx build would be to check the documentation. i try to fix it in #450 but did not find why it was not working, and then did not find more time to continue...

@XWB XWB deleted the event-dispatcher-fix branch November 6, 2019 12:49
@XWB XWB mentioned this pull request Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants