@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: Typing a comment: Gracefully handle missing author PHID

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."

Do not add null to the PHID array when there is no author PHID.

```
ERROR 8192: Using null as an array offset is deprecated, use an empty string instead at [/var/www/html/phorge/phorge/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:525]
```

Closes T16368

Test Plan: On PHP 8.5, go to any existing item (e.g. D1 or T1) and type in the Comment field.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16368

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

+1 -1
+1 -1
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 385 385 break; 386 386 } 387 387 388 - if ($this->getComment()) { 388 + if ($this->getComment() && $this->getComment()->getAuthorPHID()) { 389 389 $phids[] = array($this->getComment()->getAuthorPHID()); 390 390 } 391 391