Skip to content
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

Fix symfony 4.4 compat #3285

Merged
merged 2 commits into from
Nov 22, 2019
Merged

Fix symfony 4.4 compat #3285

merged 2 commits into from
Nov 22, 2019

Conversation

bendavies
Copy link
Contributor

@bendavies bendavies commented Nov 22, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? yes
Tickets symfony/symfony#34509
License MIT
Doc PR

If is not enough to check for the existence of Symfony\Component\HttpKernel\EventListener\ErrorListener to know if we can use it or not on symfony 4.4.

It may have been removed from the container.

The new ErrorListener is functionally different to the deprecated one, as the new one flattens exceptions with the KernelEvents::CONTROLLER_ARGUMENTS event, and not when the attributes are added.

If ErrorListener is removed from the container, the exception will never be converted to a flattened exception, causing the wrong Exception type to be passed to the ExceptionAction.

@bendavies
Copy link
Contributor Author

bendavies commented Nov 22, 2019

btw, users can fix this themselves by not using a deprecated twig configuration:
symfony/symfony#34519

{
if (class_exists(ErrorListener::class)) {
if (null !== $errorListener) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you invert the test (test for === null)

@bendavies
Copy link
Contributor Author

I have no idea why that no deprecations build is failing

@alanpoulain
Copy link
Member

It's not required, don't worry.

@dunglas
Copy link
Member

dunglas commented Nov 22, 2019

It's because FOSUser isn't compatible with Symfony 4.4 yet.

@dunglas dunglas merged commit 46171b2 into api-platform:2.5 Nov 22, 2019
@dunglas
Copy link
Member

dunglas commented Nov 22, 2019

Thanks @bendavies

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.

4 participants