HTML outputted as text when using table format with more than one grouping

Created on 10 August 2020, over 4 years ago
Updated 29 August 2024, 4 months ago

Problem/Motivation

When rendering a view with table format and more than one grouping field, the Grouping field nΒΊ1 outputs its HTML as text, no matter the configuration.

This only happens if the grouping field uses a label (which is common when using the table format). I checked the render process but couldn't trace down the problem, and have reproduced it on a clean Drupal 8.9 install using Bartik as public theme and Seven as admin theme.

Steps to reproduce

  1. Create a view with format = table.
  2. Add a pair of fields that can be used for grouping, i.e Authored by and Published
  3. Ensure that one of them will output some HTML, i.e. "Authored by" using Label as Formatter and "Link label to the referenced entity" set to true in order to output a link. Any other HTML-outputting config will work.
  4. Ensure this field also has "Create a label" set to True and a Label value
  5. Group the view results by two fields: Authored By and Published, respectively. There need to be more than one grouping enabled in order to reproduce the error.
  6. The "Authored By" grouping should wrongly output its HTML as plain text (see image below)
  7. Remove the "Authored by" label
  8. The "Authored by" output will be rendered correctly

Notes:

  • Tested only with content views using the core's Article node content type.
  • It seeems to affect only the 1st grouping field, the rest are OK.
  • Twig templates aren't involved. The field arrives wrongly rendered to the template.
  • Playing with "Use rendered output to group rows" settings didn't produce any result.

Proposed resolution

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated 35 minutes ago

Created by

πŸ‡ͺπŸ‡ΈSpain idiaz.roncero Madrid

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.

Production build 0.71.5 2024