@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

PHP 8.5: Dashboard Panels: Gracefully handle missing panel type parameter

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/controller/panel/PhabricatorDashboardPanelEditController.php:55]
```

Closes T16402

Test Plan: Go to http://phorge.localhost/dashboard/panel/edit/

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16402

Differential Revision: https://we.phorge.it/D26598

+1 -1
+1 -1
src/applications/dashboard/controller/panel/PhabricatorDashboardPanelEditController.php
··· 52 52 53 53 $panel_type = $request->getStr('panelType'); 54 54 $panel_types = PhabricatorDashboardPanelType::getAllPanelTypes(); 55 - if (empty($panel_types[$panel_type])) { 55 + if (!$panel_type || empty($panel_types[$panel_type])) { 56 56 return $this->buildPanelTypeResponse($cancel_uri); 57 57 } 58 58