Use Attribute::addClass() instead of CSS class concatenation in template_preprocess_views_view_table()

Created on 20 August 2015, over 9 years ago
Updated 22 August 2024, 4 months ago

Follow-up to #2502089: Remove SafeMarkup::set() in template_preprocess_views_view_table()

Follow-up to #2280965: [meta] Remove every SafeMarkup::set() call

Problem/Motivation

@MauPalantir noticed there was a bunch of class concatenation done in template_preprocess_views_view_table()

Proposed resolution

Use Attribute() object to addClass() and/or move the class building to the template.

Remaining tasks

Has this been fixed in 🐛 Indirect modification of overloaded element with Views responsive table Fixed ?

Manual testing steps

User interface changes

N/A

API changes

N/A

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component
Views 

Last updated 33 minutes ago

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    Points in #24 still need to be addressed.

  • 🇮🇹Italy kopeboy Milan

    Hoping this will help, here's how I can reproduce this error:

    1. Create a View with Table display and add some fields
    2. Exclude some fields from display or set some fields to the column of another field, save
    3. Change the Responsive (High/Medium/Low) of some these columns, save
    4. Get Error Notice: Indirect modification of overloaded element of Drupal\Core\Template\Attribute has no effect in template_preprocess_views_view_table() (line 569 of /var/www/html/web/core/modules/views/views.theme.inc)

    Note that:

    • You cannot remove the error until you remember or by chance set the previous columns' responsive class
    • A workaround to stop the error is to change the view display and set it back to Table to reset those settings (fields' settings will stay)
  • 🇬🇧United Kingdom catch

    Is there anything left here that's not covered by 🐛 Indirect modification of overloaded element with Views responsive table Fixed ?

  • last update about 1 year ago
    Patch Failed to Apply
  • 🇮🇳India _utsavsharma

    Patch for 11.x.
    Pointer in #24 still needs to be addressed.

  • last update about 1 year ago
    Custom Commands Failed
  • Status changed to Postponed: needs info 4 months ago
  • 🇳🇿New Zealand quietone

    There has been no answer to catch's query 11 months asking if there is more to do here. I am setting the status to Postponed (maintainer needs more info). If we don't receive confirmation that there is work to do here the issue will be closed in another month. .

    Thanks!

Production build 0.71.5 2024