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

fix: Fix deprecation notice since twig 3.10 to now use EscaperRuntime… #2997

Merged
merged 1 commit into from
May 14, 2024

Conversation

Levdbas
Copy link
Member

@Levdbas Levdbas commented May 13, 2024

Related:

Issue

Since Twig 3.10 the old methods of adding additional escapers is deprecated.

Solution

Use the new escaping extension instead with a fallback to use the old escapers. Since we support twig from version 3.5 and onward.

I took the if/else setup from here: https://github.com/symfony/ux/blob/796dd587827f2bb849064c33cc4e053c39e0a0e9/src/TwigComponent/src/Twig/TwigEnvironmentConfigurator.php

Impact

No more deprecation notices.

Usage Changes

No.

Considerations

No.

Testing

Yes. I added a test to test one of the old escaper methods so we can test that functionality as long as we support that.

@Levdbas Levdbas linked an issue May 13, 2024 that may be closed by this pull request
Copy link
Member

@nlemoine nlemoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Levdbas !

Copy link
Member

@gchtr gchtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Thanks, Erik, for digging into this!

@Levdbas Levdbas merged commit 295349b into 2.x May 14, 2024
24 checks passed
@gchtr gchtr deleted the 2993-bug-twig-310-breaks-timber branch May 14, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Twig 3.10 breaks Timber
3 participants