Automatic conversion of false to array is deprecated inย history_node_view_alter()

Created on 8 January 2025, 13 days ago

Problem/Motivation

I need to remove this line for a our enviroment.

Automatic conversion of false to array is deprecated in history_node_view_alter() (line 145 of core/modules/history/history.module

Steps to reproduce

You may install Drupal 10.4.1 version.

Proposed resolution

Before of the next line:

$build['#cache']['contexts'][] = 'user.roles:authenticated';

We should add:

if (!isset($build['#cache']['contexts']) || !is_array($build['#cache']['contexts'])) {
      $build['#cache'] = [];
}
$build['#cache']['contexts'][] = 'user.roles:authenticated';
๐Ÿ› Bug report
Status

Active

Version

10.4 โœจ

Component

history.module

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain jifernandezs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024