Fix removal of fos_rest.exception.twig_controller when templating/twig is not enabled #2012
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1772, #1887, #1945, #2002
With that you can remove
which fixes the deprecations and it will use
\FOS\RestBundle\Controller\ExceptionController
instead of\FOS\RestBundle\Controller\TwigExceptionController
correctly. This in turn means it does not use the TwigBundle error rendering but the implementation using the Serializer (Symfony or JMS). But the error response stays the same because of\FOS\RestBundle\Serializer\Normalizer\ExceptionHandler::convertToArray
(or the equivalent for Symfony serializer).So people can disable templating and twig and error rendering should still be BC.
The following part is not needed anymore with #2015
If people use TwigBundle but want to disable SF templating part to get rid of deprecations, they need to set
because otherwise the unwanted twig controller get's used again:
FOSRestBundle/DependencyInjection/FOSRestExtension.php
Lines 360 to 367 in 6013d51