Fix deprecation introduced in twig/twig 3.11.0

Created on 14 August 2024, 4 months ago
Updated 17 August 2024, 4 months ago

Problem/Motivation

twig/twig Released version 3.11.0 (See https://github.com/twigphp/Twig/releases/tag/v3.11.0) which introduces new depractions.

Amongst those is this one that affects core, and is currently suppressed in core/.deprecation-ignore.txt:

drupal\vendor\symfony\deprecation-contracts\function.php:25
Since twig/twig 3.11: Changing the value of a "filter" node in a NodeVisitor class is not supported anymore.

So our problem comes from this commit
and seems to be that we swap out the escape for our own drupal_escape filter in core/lib/Drupal/Core/Template/TwigExtension.php

That seems to be handled by the constructor now.

Steps to reproduce

Remove the suppression from core/.deprecation-ignore.txt and shiver at the wall of tests complaining about the deprecation warning.

Proposed resolution

Yep, this is above my head.

I would guess we need to do something with the EscaperRuntime class.

https://github.com/twigphp/Twig/issues/4102#issue-2323595412

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 2 days ago

Created by

πŸ‡³πŸ‡±Netherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024