node_revisions_table $build should specify class as array

Created on 3 November 2021, about 3 years ago
Updated 18 December 2023, 12 months ago

Problem/Motivation

A contrib module preprocessing table elements exposed this bug, which is that #attributes['class'] is specified as a string instead of an array when creating the node_revisions_table render element. When browsing a node revisions page, error is [] operator is not supported for strings.

Steps to reproduce

Add table preprocessing:

function MODULE_preprocess_table(&$variables) {
  $variables['attributes']['class'][] = 'newclass';
}

and browse to /node/XX/revisions

Proposed resolution

Fix the 'class' assignment.

Remaining tasks

See patch below.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
Node systemΒ  β†’

Last updated about 9 hours ago

No maintainer
Created by

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

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

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