Skip to content

Replace deprecated spaceless tag with whitespace control#2518

Open
lacatoire wants to merge 1 commit into
sonata-project:4.xfrom
lacatoire:fix/twig-spaceless-deprecation-mediaadmin-edit
Open

Replace deprecated spaceless tag with whitespace control#2518
lacatoire wants to merge 1 commit into
sonata-project:4.xfrom
lacatoire:fix/twig-spaceless-deprecation-mediaadmin-edit

Conversation

@lacatoire

@lacatoire lacatoire commented Apr 20, 2026

Copy link
Copy Markdown

The spaceless tag/filter is deprecated since Twig 3.12 and will be removed in Twig 4. Replace the two remaining occurrences with whitespace-control modifiers ({%- -%}), which is the recommended migration path and preserves the rendered output.

  • src/Resources/views/MediaAdmin/edit.html.twig (bytesToSize macro)
  • tests/App/templates/truncate_test.html.twig (truncate test fixture)

Changelog

### Changed
- Replace deprecated Twig `spaceless` tag with whitespace-control modifiers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant