Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3150351-paragraphs-spaceless-2.patch | 1.09 KB | penyaskito |
|
Comments
Comment #2
penyaskitoAttached patch
Comment #3
kiran.kadam911Comment #4
kiran.kadam911Tested 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
Comment #5
Berdirapply 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?
Comment #6
BerdirTo expand on that, a twig 2.7 deprecation means it is deprecated in Drupal 9, for Drupal 10.
Comment #7
fgmTwig 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 ?
Comment #9
BerdirRunning it on D10/Twig 3.3 doesn't seem to fail, so committing this for now.