Trying to remove the @legacy from my tests, found out:

The spaceless tag in "modules/contrib/paragraphs/templates/paragraphs-dropbutton-wrapper.html.twig" at line 16 is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead.

This seems a 1:1 replacement.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Status: Active » Needs review
FileSize
1.09 KB

Attached patch

kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs review » Reviewed & tested by the community

Tested patch #2 on local & it's working fine. {% spaceless %} replaced with {% apply spaceless %}.

Here is the list of Deprecated Features: https://twig.symfony.com/doc/2.x/deprecated.html

Berdir’s picture

apply was introduced in twig 1.40 according to https://twig.symfony.com/doc/1.x/, but drupal core requires only 1.38: "twig/twig": "^1.38.2",

I would expect this is broken with that version?

Berdir’s picture

To expand on that, a twig 2.7 deprecation means it is deprecated in Drupal 9, for Drupal 10.

fgm’s picture

Twig documentation also says "Using the spaceless tag at the root level of a child template is deprecated in Twig 2.5.0. This does not work as one would expect it to work anyway. In Twig 3.0, it will throw a Twig\Error\SyntaxError exception.",

A spaceless tag or apply is what we have here. Shouldn't we just remove the {{ apply spaceless }} too ?

  • Berdir committed cbf37ba on 8.x-1.x authored by penyaskito
    Issue #3150351 by penyaskito: spaceless is deprecated since Twig 2.7,...
Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Running it on D10/Twig 3.3 doesn't seem to fail, so committing this for now.

Status: Fixed » Closed (fixed)

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