Fix Warning: Trying to access array offset on value of type null in the system Info dashboard plugin

Created on 25 April 2023, over 1 year ago
Updated 9 January 2024, 10 months ago

Problem/Motivation

Having the following warnings

Warning: Trying to access array offset on value of type null in Drupal\dashboards\Plugin\Dashboard\SystemInfo->buildRenderArray() (line 118

Warning: Trying to access array offset on value of type null in Drupal\dashboards\Plugin\Dashboard\SystemInfo->buildRenderArray() (line 121 

Warning: Undefined array key "error" in Drupal\dashboards\Plugin\Dashboard\SystemInfo->buildRenderArray() (line 121

Steps to reproduce

Given that the Dashboards module was installed in a Drupal 10 site
And the "Error messages to display" was sat to "All messages, with backtrace information"
And a default "Webmaster Dashboard" was created
And the "Show system info" block was placed on the dashboard
When hitting the dashboard page
Then the warning shows in the dashboard and system logs

Proposed resolution

I have an extra check on arrays

Remaining tasks

  • File an issue
  • Patch/MR
  • Test
  • Review

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A
πŸ“Œ Task
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan Rajab Natshah Jordan

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

Comments & Activities

Production build 0.71.5 2024