From 4ae2bddd47bfe9e3c37c7e54a53ce66b947a5a7f Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Wed, 25 Feb 2026 18:37:34 +0100 Subject: [PATCH] PHP 8.5: Fix null array key listing Files without author 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." Looked into the phid array to spot a null value; followed up the callstack to find where it comes from and fix the root cause. ``` ERROR 8192: Using null as an array offset is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/applications/phid/query/PhabricatorObjectQuery.php:132] #0 PhabricatorObjectQuery::loadObjectsByPHID(array, array) called at [/src/applications/phid/query/PhabricatorObjectQuery.php:73] [...] #10 PhabricatorApplicationSearchEngine::buildResponse() called at [/src/applications/files/controller/PhabricatorFileListController.php:16] ``` Closes T16529 Test Plan: * PHP 8.5 * Have some files that recently got automagically created (like user avatars, or maybe also transforms) * Go to http://phorge.localhost/file/query/all/ and make sure "Upload Source" says "(Show All)" Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16529 Differential Revision: https://we.phorge.it/D26801 --- src/applications/files/query/PhabricatorFileSearchEngine.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/files/query/PhabricatorFileSearchEngine.php b/src/applications/files/query/PhabricatorFileSearchEngine.php index c565ba9204..125a0bce87 100644 --- a/src/applications/files/query/PhabricatorFileSearchEngine.php +++ b/src/applications/files/query/PhabricatorFileSearchEngine.php @@ -127,7 +127,9 @@ final class PhabricatorFileSearchEngine protected function getRequiredHandlePHIDsForResultList( array $files, PhabricatorSavedQuery $query) { - return mpull($files, 'getAuthorPHID'); + + // Remove non-manually created files which do not have an author + return mpull(mfilter($files, 'getAuthorPHID'), 'getAuthorPHID'); } /** -- 2.51.2