Markup tags are escaped when aggregating by value

Created on 12 November 2018, about 6 years ago
Updated 23 August 2024, 4 months ago

Problem/Motivation

Steps to reproduce:

  1. Install Drupal with the Standard profile.
  2. Edit the Content view (/admin/structure/views/view/content).
  3. Add the Body field to the view (or any formatted text field).
  4. Enable aggregation. ("Use aggregation: Yes" under "Advanced".)
  5. Save the view.
  6. Create a few test articles.
  7. Visit the Content page (/admin/content).

After these steps, you will see things like <p>This is the body of the first article.</p>.

Proposed resolution

Do not escape HTML in this case.

I am not sure if this is a workaround or the intended approach, but if you change the aggregation setttings for the Body field from "Value" to "Entity ID", then the text appears properly.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated 16 minutes ago

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I tested on Drupal 10.1.x, standard install and this is reproducible.

  • πŸ‡΅πŸ‡ΉPortugal jrochate

    This can be solved if you go to body field (or other text formatted field) Aggregation settings and check the box Format under Group columns (additional).

    After this, the HTML is rendered even with views aggregation activated.

    Changing the aggregation settings from Value to Entity ID, like proposed by OP can have side effects on certain query conditions.

  • πŸ‡ΊπŸ‡ΈUnited States caspervoogt

    I ran into this on 10.2.x and 10.3.x. I tried the "Entity ID" workaround by OP as well as jrochate's suggestion in #13, and neither worked for me.

    What did work for me was to re-create my view display within my existing view. For whatever reason, my existing display would start exhibiting this issue as soon as I activated aggregation on it. The new display displays fine with aggregation.

Production build 0.71.5 2024