Views grouping field is double-escaped

Created on 10 March 2021, almost 4 years ago
Updated 22 January 2023, about 2 years ago

Problem/Motivation

Views grouping field is not rendered properly if the field has any HTML special characters. For example, an apostrophe is rendered as '

Steps to reproduce

  1. Create a node with an apostrophe in its title
  2. Create a view displaying nodes
  3. Configure your view to group by node title
  4. In a view either add a label to your node title field or tip the "Remove tags from rendered output" checkbox in the grouping settings
  5. It will replace an apostrophe with a corresponding HTML entity ' when the grouping field is rendered

Proposed resolution

Grouping field variable should be a Markup object, not a string. In that case the twig template will render HTML special characters properly.

Remaining tasks

test, review the patch, propose a better solution.

Release notes snippet

HTML special characters are rendered correctly in Views grouping.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¨πŸ‡¦Canada klimp MontrΓ©al, QC

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
Production build 0.71.5 2024