From cc79be5a5a5426b1af8531ff9a227cfcb93a3669 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sat, 3 Jan 2026 18:48:11 +0100 Subject: [PATCH] Fix PHP 8.5 null array key creating a Dashboard Panel without layoutMode set Summary: Setting null as an array key is deprecated since PHP 8.5 per https://www.php.net/releases/8.5/en.php: "Using null as an array offset or when calling array_key_exists() is now deprecated. Use an empty string instead." ``` ERROR 8192: Using null as an array offset is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php:16] ``` Closes T16431 Test Plan: * PHP 8.5 * Go to http://phorge.localhost/dashboard/edit/form/default/ * Create a dashboard with "Layout" set to "Two Columns: 33%/66%" Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16431 Differential Revision: https://we.phorge.it/D26651 --- .../dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php b/src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php index 7135522840..3d9b7d83ed 100644 --- a/src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php +++ b/src/applications/dashboard/layoutconfig/PhabricatorDashboardPanelRefList.php @@ -13,7 +13,7 @@ final class PhabricatorDashboardPanelRefList $mode_map = PhabricatorDashboardLayoutMode::getAllLayoutModes(); $mode_key = idx($config, 'layoutMode'); - if (!isset($mode_map[$mode_key])) { + if ($mode_key === null || !isset($mode_map[$mode_key])) { $mode_key = head_key($mode_map); } $mode = $mode_map[$mode_key]; -- 2.51.2