Twig debug overrides custom defined views row classes

Created on 23 November 2019, over 4 years ago
Updated 13 July 2023, 11 months ago

Problem/Motivation

I've added the global View result counter field to the view and then use the replacement pattern for this field in the 'Row class' setting like this views-row-{{ counter }}.

I have defined class so that it will add views-row-1, views-row-2 etc. to every row with a counter:

if I enable twig debug, the class I defined from views seems to be overriden and replaced with twig debug information.

Steps to reproduce

  1. Enable twig debug
  2. Create view with using fields format
  3. Add a global View result counter field to the view
  4. Add the counter replacement patterns in the view Row class format settings
  5. . Eg: row - {{ counter }}

  6. Inspect the view html and you'll see the debug info appearing in the row class section (refer issue screenshot)

Proposed resolution

Remove twig debug information from the getRowClass() function in views.

🐛 Bug report
Status

Needs work

Version

9.5

Component
Markup 

Last updated 1 day ago

No maintainer
Created by

🇹🇷Turkey RgnYLDZ

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.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.69.0 2024