Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #2012 Fix removal of fos_rest.exception.twig_controller when temp…
…lating/twig is not enabled (Tobion) This PR was squashed before being merged into the 2.5-dev branch (closes #2012). Discussion ---------- Fix removal of fos_rest.exception.twig_controller when templating/twig is not enabled Fixes #1772, #1887, #1945, #2002 With that you can remove ``` framework: templating: engines: twig ``` 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 it should still be BC. If people use TwigBundle but want to disable SF templating part to get rid of deprecations, they need to set ``` fos_rest: exception: exception_controller: 'fos_rest.exception.controller::showAction' ``` because otherwise the unwanted twig controller get's used again: https://github.com/FriendsOfSymfony/FOSRestBundle/blob/6013d5131f94cd7367c423e52bdfb83c4f0613f9/DependencyInjection/FOSRestExtension.php#L360-L367 Commits ------- a2c8639 Fix removal of fos_rest.exception.twig_controller when templating/twig is not enabled
- Loading branch information