- Issue created by @longwave
- 🇫🇷France andypost
The only failure https://github.com/twigphp/Twig/pull/4019 which may affect contrib as well
- Status changed to Needs review
7 months ago 4:30pm 16 April 2024 - 🇬🇧United Kingdom longwave UK
Swapped AbstractNodeVisitor for NodeVisitorInterface. Don't think we need to provide BC as the class names are hardcoded in TwigExtension and aren't swappable.
- Status changed to Needs work
7 months ago 5:18pm 16 April 2024 - 🇬🇧United Kingdom longwave UK
Thanks @Spokje over in 📌 Bump twig/twig to 3.9.0 Closed: duplicate for finding https://github.com/twigphp/Twig/issues/4008 - we use
display_end
in TwigNodeVisitorCheckDeprecations which appears to be why it's stopped working. - Status changed to Postponed
7 months ago 11:36am 17 April 2024 - 🇬🇧United Kingdom longwave UK
Postponed on the above, nothing we can do until Twig fixes this.
- 🇫🇷France andypost
commented our case https://github.com/twigphp/Twig/issues/4008#issuecomment-2061086856
- 🇳🇱Netherlands spokje
To be fair, we can still:
- Bump
twig/twig
to 3.9.1 which fixesException: Warning: Undefined variable $blocks
.
- Bump to that version incomposer.json
, since lower version won't pass with theyield
changes.Did that just now.
- 🇫🇷France andypost
@Spokje thank you, now all functional tests passed and only left is deprecation test which is blocked on twig
- 🇬🇧United Kingdom longwave UK
https://github.com/twigphp/Twig/pull/4028 fixes the issue for me, commented over in https://github.com/twigphp/Twig/issues/4008
- Status changed to Needs review
7 months ago 2:38pm 17 April 2024 - Status changed to RTBC
7 months ago 7:22pm 17 April 2024 - Status changed to Needs review
7 months ago 9:59pm 17 April 2024 - 🇺🇸United States xjm
Looked over the Twig release notes and compared them to the individual changes. All seem correct. Couple questions though:
What are the chances of Twig's update disrupting contrib/custom code edgecases? Some of the changes we had to make to the core tests are just replacing a deprecated implementation with a better one, but one appears to be hard-breaking (although I'm not sure exactly what the consequences of not doing it are from the Twig release notes). There are two decisions that would depend on this:
- Whether we add a brief release note with a link to Twig's update info about anything.
- What we do with the Twig version and constraint for 10.3.
Thanks!
- Status changed to RTBC
7 months ago 10:52am 18 April 2024 - 🇬🇧United Kingdom longwave UK
Ignoring the bug in Twig 3.9.0/3.9.1, as far as I can tell the changes are all backward-compatible.
If you were extending AbstractNodeVisitor you should swap to implementing NodeVisitorInterface directly instead.
If you were using
echo
orprint
in::compile()
you should swap toyield
and add the#[YieldReady]
attribute.Contrib should not be affected by this because none of these are swappable parts; Twig should issue deprecations that they can fix in their own time. Therefore I think we should backport this to 10.3 so contrib can upgrade when they are ready.
I think we should add a release note to 10.3.0 and 11.0.0 linking to the Twig release note, added a snippet.
- Status changed to Needs work
7 months ago 1:28pm 18 April 2024 -
alexpott →
committed 973b6ec1 on 11.x
Issue #3441331 by andypost, longwave, Spokje, xjm: Update to Twig 3.9
-
alexpott →
committed 973b6ec1 on 11.x
- Status changed to Needs review
7 months ago 1:35pm 18 April 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Decided to do what I would have done on commit in a branch and push it to the MR repo...
- 🇫🇷France andypost
MR needs to set back to 3.9.2 or needs followup for 11.x as 1h ago https://github.com/twigphp/Twig/releases/tag/v3.9.3
https://github.com/twigphp/Twig/blob/3.x/CHANGELOG
# 3.9.3 (2024-04-18)
* Add missing `twig_escape_filter_is_safe` deprecated function
* Fix yield usage with CaptureNode
* Add missing unwrap call when using a TemplateWrapper instance internally
* Ensure Lexer is initialized early on - Status changed to Needs work
7 months ago 2:28pm 18 April 2024 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
-
alexpott →
committed 71151b5e on 11.x
Issue #3441331 follow-up:wq: Update to Twig 3.9
-
alexpott →
committed 71151b5e on 11.x
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
@andypost I just pushed a quick follow-up to get us to 3.9.3 as we've had a test run on 10.3.x and it did not cuase any issues. Gonna update the 10.3 MR to have the same minimum.
- Status changed to RTBC
7 months ago 3:00pm 18 April 2024 - Status changed to Fixed
7 months ago 4:11pm 18 April 2024 -
alexpott →
committed 5a43c22f on 10.3.x
Issue #3441331 by andypost, longwave, alexpott, Spokje, xjm: Update to...
-
alexpott →
committed 5a43c22f on 10.3.x
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇷🇺Russia Chi
Since twig/twig 3.9: Twig node "Drupal\Core\Template\TwigNodeTrans" is not marked as ready for using "yield" instead of "echo"; please make it ready and then flag it with the #[YieldReady] attribute.
Twig deprecations may break contrib tests. Can we backport this fix to Drupal 10.2?