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

Created on 8 January 2025, 4 months 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 jifernandezseda

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