@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: Differential: Avoid null array key for revision without history

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 pass a `null` value in the array down to Arcanist's `array_select_keys()` when there is no `$diff_vs`.

```
ERROR 8192: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead at [/var/www/html/phorge/arcanist/src/utils/utils.php:634]
#0 array_select_keys(array, array) called at [<phorge>/src/applications/differential/controller/DifferentialRevisionViewController.php:369]
```

Closes T16382

Test Plan: Go to a Differential Revision which only has its first Diff and no History.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16382

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

+6 -1
+6 -1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 366 366 ->setErrors($revision_warnings); 367 367 } 368 368 369 + if ($diff_vs === null) { 370 + $diff_keys = array($target->getID()); 371 + } else { 372 + $diff_keys = array($diff_vs, $target->getID()); 373 + } 369 374 $detail_diffs = array_select_keys( 370 375 $diffs, 371 - array($diff_vs, $target->getID())); 376 + $diff_keys); 372 377 $detail_diffs = mpull($detail_diffs, null, 'getPHID'); 373 378 374 379 $this->loadHarbormasterData($detail_diffs);