Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Follow-up to #2864031-28: Update twig/twig from v1.25.0 to v1.32.0
Problem/Motivation
Update twig/twig to v1.35.0 see https://github.com/twigphp/Twig/blob/v1.35.0/CHANGELOG for complete detail.
Proposed resolution
Update twig/twig from v1.32.0 to v1.35.0
Remaining tasks
Review.
User interface changes
None
API changes
See the change record.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#3 | update_twig_twig_from-2912542-3.patch | 3.52 KB | jibran |
Comments
Comment #2
andypostThere's BC break with safe markup
Comment #3
jibranHere we go!
Comment #4
jibranCreated https://www.drupal.org/node/2912663.
Comment #6
jibranComment #7
HazaJust wondering why do we have an update in this test ?
Thanks
Comment #8
cburschkaJust guessing, but the CR mentions that Twig's length() and empty() now treat strings and string-able non-countables as if they were arrays of characters. Basically, they work on the string length if the value doesn't implement \Countable.
That means the
<span></span>
value is no longer empty, so it needs to be changed into an empty string to work correctly.Comment #9
jibranPatch is green change notice is added so this is ready for reveiw . @Haza and @cburschka please see https://github.com/twigphp/Twig/pull/2420 for more details.
Comment #10
joelpittetComment #11
jibranDone.
Comment #12
joelpittetThanks @jibran, the change record is for that change. Upstream they fixed a bug where empty objects would be considered not empty string values even if that is what they returned.
I think this would be great to have during the start of the 8.5.x cycle.
Comment #13
alexpottHere are all the changes:
The
fixed PHP 7.2 compatibility
seems really important - but turns out that the related commits are only fixing tests. The most interesting thing here is the addition of the namespaced classes to make migration to Twig 2.x much simpler.Comment #14
alexpottCommitted 693aed2 and pushed to 8.5.x. Thanks!
Comment #16
jibranThanks, @alexpott I have published the change record as well.
Comment #17
hass CreditAttribution: hass commentedI thought D8 is compatible with HHVM? Now this support is removed. This also means system requirements need to be updated. The people who use HHVM will be unhappy I guess.
Comment #18
alexpottHHVM support is not promised at all - see https://www.drupal.org/docs/8/system-requirements/php - also there is no mention of HHVM in core code at all. We have no idea if Drupal 8 passes tests on HHVM either.
Comment #19
alexpottAlso we really can't afford to stay too far behind with Twig - it is our templating layer if there is a security release for it we'd have to update right away.
Comment #20
hass CreditAttribution: hass commentedComment #21
daffie CreditAttribution: daffie commentedIf I install Drupal 8.4.0 with composer:
I get Twig 1.35 but not the fix for TwigMarkupInterfaceTest. And as a result the test does not passes any more.
Comment #22
daffie CreditAttribution: daffie commentedSelecting the right version 8.4.0.
Comment #23
jibranThis is not backported to 8.4.x. For 8.4.x twig is locked v1.32.0. Please check your settings or use https://github.com/webflo/drupal-core-strict to use 8.4.x version of twig.
Comment #25
xjmFollowing 8.4.0, the "release notes" tags should only be used for critical information site owners need when updating their sites.