Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[TwigBundle] Deprecating error templates for non-html formats and using ErrorRenderer as fallback#31398
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
752e607 toefaf91eComparesrc/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
yceruto commentedMay 6, 2019
Hi@OskarStark thanks for your review, but they aren't part of this PR (see description), the last commit should be reviewed for now. Please, move them to#31065 to track them in the right place ;) |
dafcc21 toeea898fCompareyceruto commentedMay 7, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
eea898f#diff-21899d8070b2bcedfb8ab7f6993331deR73 I have a problem with the ErrorHandler in functional tests, it does not work because the |
Uh oh!
There was an error while loading.Please reload this page.
eea898f to61d2b9aCompareyceruto commentedMay 8, 2019
Status: Needs work |
yceruto commentedJun 5, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Check later if#31868 solve this issue#31398 (comment). |
fabpot commentedJun 5, 2019
@yceruto Yes, it should fix the issue. I found it while reviewing your PR and Nicolas kindly fixed it. It will soon be on all branches so that you can rebase and see if that works (I tested locally and it worked well). |
yceruto commentedJun 5, 2019
@fabpot perfect!! thanks. |
61d2b9a toc2f4fc2Compare35755ef to46f9183Compareyceruto commentedJul 23, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
requires#32693 to make it work properly |
018d4f3 tob95087cCompareb95087c to9266107CompareUh oh!
There was an error while loading.Please reload this page.
9266107 tobf0c24aCompare…ode (preview mode) (yceruto)This PR was merged into the 4.4 branch.Discussion----------[ErrorRenderer] Allow disabling debug content in debug mode (preview mode)| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MITRequired by#31398 to show a preview mode of the error for each content format.Usage:https://github.com/symfony/symfony/pull/31398/files#diff-9ff5216ab011f5e48c7835d4138bf825R42Note that you can't enable the debug content in non-debug mode via `X-Debug`. I also added more tests.Commits-------a6bef5e Allow disabling debug content in debug mode (preview mode)
Tobion commentedJul 24, 2019
It took time, but here we go, this is in now. Thank you very much@yceruto. |
…formats and using ErrorRenderer as fallback (yceruto)This PR was merged into the 4.4 branch.Discussion----------[TwigBundle] Deprecating error templates for non-html formats and using ErrorRenderer as fallback| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -In the previous [PR](#31065) we created a new mechanism to render any PHP error/exception in a formatted string, which if the FB is enabled, would return an HTTP Response according to the preferred Request format (html, json, xml, txt, etc.), but when installing the TwigBundle this rendering mechanism is replaced by the current ExceptionController.This ExceptionController allows us to render custom error pages based on Twig in many formats, just what is already supported with the new ErrorRenderer component, so let's deprecate this in favor of the native.Commits-------bf0c24a Deprecating error templates for non-html formats and using ErrorRenderer
This PR was merged into the 5.0-dev branch.Discussion----------[TwigBundle] remove deprecations and fix tests| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | yes <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets || License | MIT| Doc PR |Removing deprecations from#31398 which should also fix tests in master as I removed some legacy code like (`exception_controller: ~ # to be removed in 5.0 relying on default`) while resolving conflicts when merging 4.4 into master.Commits-------452f66d [TwigBundle] remove deprecations
…e new ErrorRenderer mechanism (yceruto)This PR was merged into the 4.4 branch.Discussion----------[WebProfilerBundle] Decoupling TwigBundle and using the new ErrorRenderer mechanism| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets |#31398 (comment)| License | MIT| Doc PR | -Commits-------846d3e0 Decoupling TwigBundle and using the new ErrorRenderer mechanism
… the error renderer mechanism (yceruto)This PR was merged into the 4.4 branch.Discussion----------Added new ErrorController + Preview and enabling there the error renderer mechanism| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes (deps=high failure is normal)| Fixed tickets | -| License | MIT| Doc PR | TODOAfter deprecating the `ExceptionController` in TwigBundle (refs#31398) the `twig.exception_controller` config key becomes useless as feature provided by TwigBundle, while the preview controller is taking more relevance for the error renderer mechanish.**Proposal** * Deprecate the `twig.exception_controller` config key in favor of `framework.error_controller` with default `ErrorController` that activates the error renderer mechanism through the current `ExceptionListener`, meaning also that `DebugHandlersListener::onKernelException` method becomes useless too. * Deprecate the `PreviewErrorController` from TwigBundle in favor of similar in FrameworkBundle.So you no longer need to install TwigBundle to create a custom error controller or check the preview output of an error renderer (included `TwigHtmlErrorRenderer`).Btw this wouldfix#31398 (comment), removing here workaround in SecurityBundle.TODO:- [x] Update CHANGELOG & UPGRADE files- [x] Add testsWDYT?Commits-------b79532a Add ErrorController to preview and render errors
… the error renderer mechanism (yceruto)This PR was merged into the 4.4 branch.Discussion----------Added new ErrorController + Preview and enabling there the error renderer mechanism| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes (deps=high failure is normal)| Fixed tickets | -| License | MIT| Doc PR | TODOAfter deprecating the `ExceptionController` in TwigBundle (refssymfony/symfony#31398) the `twig.exception_controller` config key becomes useless as feature provided by TwigBundle, while the preview controller is taking more relevance for the error renderer mechanish.**Proposal** * Deprecate the `twig.exception_controller` config key in favor of `framework.error_controller` with default `ErrorController` that activates the error renderer mechanism through the current `ExceptionListener`, meaning also that `DebugHandlersListener::onKernelException` method becomes useless too. * Deprecate the `PreviewErrorController` from TwigBundle in favor of similar in FrameworkBundle.So you no longer need to install TwigBundle to create a custom error controller or check the preview output of an error renderer (included `TwigHtmlErrorRenderer`).Btw this wouldfixsymfony/symfony#31398 (comment), removing here workaround in SecurityBundle.TODO:- [x] Update CHANGELOG & UPGRADE files- [x] Add testsWDYT?Commits-------b79532ab0e Add ErrorController to preview and render errors
Uh oh!
There was an error while loading.Please reload this page.
In the previousPR we created a new mechanism to render any PHP error/exception in a formatted string, which if the FB is enabled, would return an HTTP Response according to the preferred Request format (html, json, xml, txt, etc.), but when installing the TwigBundle this rendering mechanism is replaced by the current ExceptionController.
This ExceptionController allows us to render custom error pages based on Twig in many formats, just what is already supported with the new ErrorRenderer component, so let's deprecate this in favor of the native.