in admin_toolbar_toolbar_alter(), Trying to access array offset on value of type null

Created on 29 May 2025, 26 days ago

Problem/Motivation

Since updating to 3.6.0 we are seeing this in the logs:

 │              [%type] => Warning
  │              [@message] => __PHP_Incomplete_Class Object
  │                  (
  │                      [__PHP_Incomplete_Class_Name] => Drupal\Core\Render\Markup
  │                      [string:protected] => Trying to access array offset on value of type null
  │                  )
  │  
  │              [%function] => admin_toolbar_toolbar_alter()
  │              [%file] => /var/www/drupal/web/modules/drupal/admin_toolbar/admin_toolbar.module
                  [%line] => 39

That's a little funny since I see that key is in the install config, but the code could easily be more defensive and use an empty() check instead of checking exactly for TRUE.

Proposed resolution

Use empty()

🐛 Bug report
Status

Active

Version

3.6

Component

Code

Created by

🇺🇸United States pwolanin

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