Problem/Motivation
https://github.com/twigphp/Twig/releases/tag/v3.9.0
New features and some deprecations so I expect this to break tests: https://github.com/twigphp/Twig/blob/3.x/CHANGELOG
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Twig has been upgraded to v3.9.3. If you have custom code that extends Twig, you should read the v3.9.0 changelog as there are new deprecations in this version that may affect you.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | 3441331-nr-bot.txt | 90 bytes | needs-review-queue-bot |
Issue fork drupal-3441331
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3441331-10.3.x
changes, plain diff MR !7581
- 3441331-update-to-twig
changes, plain diff MR !7523
Comments
Comment #3
andypostThe only failure https://github.com/twigphp/Twig/pull/4019 which may affect contrib as well
Comment #4
longwaveSwapped AbstractNodeVisitor for NodeVisitorInterface. Don't think we need to provide BC as the class names are hardcoded in TwigExtension and aren't swappable.
Comment #5
andypostMaybe CR explaining this swap makes sense
Comment #6
andypostnow 2 more
- https://github.com/twigphp/Twig/commit/e70777405dd3dd1496d46b626f0b8589e...
- https://github.com/twigphp/Twig/commit/14d38036477b93976b56b1ee7046e86a3...
Comment #7
andyposthope this should be enough
Comment #8
andypostNeeds more work for
yeildComment #10
longwaveThanks @Spokje over in #3441417: Bump twig/twig to 3.9.0 for finding https://github.com/twigphp/Twig/issues/4008 - we use
display_endin TwigNodeVisitorCheckDeprecations which appears to be why it's stopped working.Comment #11
longwavePostponed on the above, nothing we can do until Twig fixes this.
Comment #12
andypostcommented our case https://github.com/twigphp/Twig/issues/4008#issuecomment-2061086856
Comment #13
spokjeTo be fair, we can still:
- Bump
twig/twigto 3.9.1 which fixesException: Warning: Undefined variable $blocks.- Bump to that version in
composer.json, since lower version won't pass with theyieldchanges.Did that just now.
Comment #14
andypost@Spokje thank you, now all functional tests passed and only left is deprecation test which is blocked on twig
Comment #15
longwavehttps://github.com/twigphp/Twig/pull/4028 fixes the issue for me, commented over in https://github.com/twigphp/Twig/issues/4008
Comment #16
spokje3.9.2 landed and made it all better.
Comment #17
longwaveGood work everyone.
Comment #18
xjmLooked 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:
Thanks!
Comment #19
longwaveIgnoring 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
echoorprintin::compile()you should swap toyieldand 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.
Comment #20
alexpottCommitted 973b6ec and pushed to 11.x. Thanks!
Let's get an MR for 10.3 rolling. I thought about cherry-picking and doing the composer work on commit but I think a test run is worth it.
Comment #24
alexpottDecided to do what I would have done on commit in a branch and push it to the MR repo...
Comment #25
andypostMR 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
Comment #26
needs-review-queue-bot commentedThe 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.
Comment #27
alexpottComment #29
alexpottComment #30
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.
Comment #31
andypostI hope it will be green
Comment #32
alexpottCommitted 5a43c22 and pushed to 10.3.x. Thanks!
Comment #36
chi commentedTwig deprecations may break contrib tests. Can we backport this fix to Drupal 10.2?