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

Use Twig instead of templating #6797

Merged
merged 1 commit into from Aug 8, 2023

Conversation

yguedidi
Copy link
Contributor

@yguedidi yguedidi commented Aug 5, 2023

Removed the framework.templating option, configure the Twig bundle instead.

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


// 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);
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Comment on lines +87 to +89
zone:
- { path: ^/api }
- { path: ^/annotations }
Copy link
Contributor Author

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...
Copy link
Contributor Author

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

@Kdecherf Kdecherf added this to the 2.6.3 milestone Aug 8, 2023
Copy link
Member

@Kdecherf Kdecherf left a 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

@Kdecherf Kdecherf merged commit 60cb8c0 into wallabag:master Aug 8, 2023
19 checks passed
@yguedidi yguedidi deleted the use-twig-instead-of-templating branch August 8, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants