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
Use Twig instead of templating #6797
Use Twig instead of templating #6797
Conversation
|
||
// For error pages, try to find a template for the specific HTTP status code and format | ||
if (!$showException) { | ||
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was the only difference from the base one, so now the base error template is moved to use the official way of overriding a template from a bundle
param_fetcher_listener: true | ||
body_listener: true | ||
exception: | ||
serializer_error_renderer: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is needed so that exceptions thrown manually in rest controllers like in https://github.com/wallabag/wallabag/blob/master/src/Wallabag/ApiBundle/Controller/EntryRestController.php#L313 respond with JSON instead of HTML
zone: | ||
- { path: ^/api } | ||
- { path: ^/annotations } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added because of the addition of serializer_error_renderer
@@ -117,9 +119,6 @@ fos_rest: | |||
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false } | |||
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false } | |||
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false } | |||
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener | |||
# so we need to add custom rule for custom api export but also for all other routes of the application... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about the "for custom api export" part here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, made some calls on the API as well to check
from https://github.com/symfony/symfony/blob/4.4/UPGRADE-5.0.md#frameworkbundle
remove ~1180 direct depreciation, see from 2119 to 940 for example