Problem/Motivation

There's new release which breaks lots of tests https://github.com/twigphp/Twig/blob/v3.15.0/CHANGELOG

Steps to reproduce

Upgrade and run tests

Proposed resolution

Upgrade and fix deprecations

- https://github.com/twigphp/Twig/pull/4335
- https://github.com/twigphp/Twig/pull/4398

Remaining tasks

- fix code and review
- commit

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3488365

Command icon 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:

Comments

andypost created an issue. See original summary.

andypost’s picture

andypost’s picture

Status: Active » Needs work
andypost’s picture

    1) /builds/issue/drupal-3488365/vendor/symfony/deprecation-contracts/function.php:25
    Since twig/twig 3.15: Instantiating "Twig\Node\Node" directly is deprecated; the class will become abstract in 4.0.
andypost’s picture

Issue summary: View changes
longwave’s picture

@andypost given we are so close to 11.1/10.4 it might be worth just skipping the new deprecations and then fixing them individually in followups like we did for the last round in Twig?

andypost’s picture

@longwave sounds like the best option!

andypost’s picture

Filed plan issue #3488409: Fix twig 3.15 deprecations

PS: looks like few tests still needs tuning

andypost’s picture

On other hand there's only 3 places to fix in core and tests are green https://git.drupalcode.org/project/drupal/-/merge_requests/10247

andypost’s picture

Status: Needs work » Needs review

As new classes in-use - pinned the minimal version

andypost’s picture

Fixed deprecations as they are regular expressions, thanks @longwave

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, I think we should just commit the fixes here given it is only changing Node to Nodes - not worth deferring that to a followup.

Ideally we will get this into both 11.1.0 and 10.4.0.

bbrala’s picture

I agree, we should commit the fixes too if possible. Don't want the same as we did with 3.14.

bbrala’s picture

The code looks good. The split between node and nodes did confuse me a little when seeing the namespace still there, but that does make sense.

Id opt to fix with deprecation fixes. Since, as longwace argues, its pretty small change.

+1 on rtbc

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 11.x, 11.1.x, 10.5.x and 10.4.x. Thanks!

  • longwave committed c10262e1 on 10.4.x
    Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0
    

  • longwave committed 9bff4f2d on 10.5.x
    Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0
    

  • longwave committed 9c1da89f on 11.1.x
    Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0
    

  • longwave committed aa5bd859 on 11.x
    Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0
    
longwave’s picture

longwave’s picture

Version: 11.x-dev » 10.4.x-dev

  • longwave committed 7f749579 on 10.4.x
    Revert "Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0"
    
    This...

  • longwave committed 316004d2 on 10.5.x
    Revert "Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0"
    
    This...
longwave’s picture

Version: 10.4.x-dev » 10.5.x-dev
Status: Fixed » Needs work

This broke various tests on 10.4/10.5:

      2x: Since twig/twig 3.15: Using the "deprecated", "deprecating_package",
    and "alternative" options is deprecated, pass a "deprecation_info" one
    instead.

longwave’s picture

Status: Needs work » Needs review
spokje’s picture

Status: Needs review » Reviewed & tested by the community

Fail in tests seems like a random BlockCacheTest fail. RTBC-ing

  • longwave committed a7400832 on 10.4.x
    Issue #3488365 by andypost, longwave: Upgrade twig/twig to 3.15.0
    

  • longwave committed 860fe111 on 10.5.x
    Issue #3488365 by andypost, longwave: Upgrade twig/twig to 3.15.0
    
longwave’s picture

Version: 10.5.x-dev » 10.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed to 10.5.x and 10.4.x, thanks!

andypost’s picture

There's 3.16 release but looks to downgrades detected https://github.com/twigphp/Twig/blob/v3.16.0/CHANGELOG

Added it for 10.4/10.5 in #3490183: Update Composer dependencies for 10.4.0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.