@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
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PHP 8.5: Maniphest: Do not pass a null array entry to loadHandles()

Summary:
`PhabricatorHandlePool::newHandleList(array $phids)` does `$this->handles[$phid]`. The passed array sometimes has two items, the first being a null element. `PhabricatorHandlePool::newHandleList` is called by `PhabricatorUser::loadHandles()` is called by `ManiphestTaskDetailController::buildCurtain()` which can pass null as the first element in `$handles = $viewer->loadHandles(array($owner_phid, $author_phid));`.

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/phid/handle/pool/PhabricatorHandlePool.php:29]
```

Closes T16359

Test Plan: Visit a Maniphest task without an assignee set in PHP 8.5. Get one error less.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16359

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

+5 -1
+5 -1
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 415 415 $viewer_phid = $viewer->getPHID(); 416 416 $owner_phid = $task->getOwnerPHID(); 417 417 $author_phid = $task->getAuthorPHID(); 418 - $handles = $viewer->loadHandles(array($owner_phid, $author_phid)); 418 + if ($owner_phid) { 419 + $handles = $viewer->loadHandles(array($owner_phid, $author_phid)); 420 + } else { 421 + $handles = $viewer->loadHandles(array($author_phid)); 422 + } 419 423 420 424 $assigned_refs = id(new PHUICurtainObjectRefListView()) 421 425 ->setViewer($viewer)