From f5cb1445344e740f1b5c7590a59c7ee6a49fb1e3 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Wed, 17 Dec 2025 13:42:23 +0100 Subject: [PATCH] PHP 8.5: Typeahead Results: Gracefully handle missing source class 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/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:36] ``` Closes T16404 Test Plan: Go to http://phorge.localhost/typeahead/class/ on PHP 8.5 Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16404 Differential Revision: https://we.phorge.it/D26600 --- .../PhabricatorTypeaheadModularDatasourceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php index e113a6e106..64385c6f10 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php @@ -33,7 +33,7 @@ final class PhabricatorTypeaheadModularDatasourceController ->setAncestorClass(PhabricatorTypeaheadDatasource::class) ->execute(); - if (isset($sources[$class])) { + if ($class && isset($sources[$class])) { $source = $sources[$class]; $parameters = array(); -- 2.51.2