Problem/Motivation

spaceless tag has been removed in Twig 3. It is not used in Drupal 9 anymore.

Proposed resolution

Use spaceless filter instead in Drupal 8 too to help new sites become compatible with Twig 3 / Drupal 10.
https://twig.symfony.com/doc/3.x/filters/spaceless.html

Before:

{% spaceless %}

{% endspaceless %}

After:

{% apply spaceless %}

{% endapply %}

Remaining tasks

Create a patch.

User interface changes

None.

Issue fork flag-3456584

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

saidatom created an issue. See original summary.

saidatom’s picture

Status: Active » Closed (outdated)
malcomio’s picture

Status: Closed (outdated) » Active
Related issues: +#3443224: Spaceless Tag Issue

Should this have been closed as outdated?

There's still a spaceless tag in https://git.drupalcode.org/project/flag/-/blob/8.x-4.x/templates/flag.ht..., and a scan with Upgrade Status reports incompatibility with Drupal 11 in themes that have templates based on it.

See also #3443224: Spaceless Tag Issue and #3477375: Provide non-deprecated replacement for Twig "spaceless" filter

berdir’s picture

That's a new deprecation, its actually the new syntax proposed here.

I think a new issue makes more sense

niharika.s’s picture

I have applied all the changes.

niharika.s’s picture

Status: Active » Needs review
ivnish’s picture

Status: Needs review » Needs work

@niharika.s your patch is empty

shivam_tiwari made their first commit to this issue’s fork.

shivam_tiwari’s picture

Status: Needs work » Needs review
karangarske’s picture

StatusFileSize
new613 bytes

created patch file for this. file goes in root/patches. this would be my first patch file. i tested it and patch worked. on drupal 10.4

rudi teschner’s picture

Missed one occurrence of spaceless in submodule that was pointed out as warning in upgrade status module.

File: modules/contrib/flag/modules/flag_count/templates/flag-count.html.twig
Line: 14
Warning: Since twig/twig 3.12: Twig Filter "spaceless" is deprecated. See https://drupal.org/node/3071078.

File: modules/contrib/flag/templates/flag.html.twig
Line: 17
Warning: Since twig/twig 3.12: Twig Filter "spaceless" is deprecated. See https://drupal.org/node/3071078.

shivam_tiwari’s picture

@rudi teschner Thanks for informing. I updated MR also related to it.

ivnish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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