@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: Almanac Interface Network: Fix feed title setting new device

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/phid/handle/pool/PhabricatorHandlePool.php:29]
#0 PhabricatorHandlePool::newHandleList(array) called at [<phorge>/src/applications/people/storage/PhabricatorUser.php:973]
#1 PhabricatorUser::loadHandles(array) called at [<phorge>/src/applications/people/storage/PhabricatorUser.php:987]
#2 PhabricatorUser::renderHandle(NULL) called at [<phorge>/src/applications/transactions/storage/PhabricatorModularTransactionType.php:185]
#3 PhabricatorModularTransactionType::renderHandle(NULL) called at [<phorge>/src/applications/transactions/storage/PhabricatorModularTransactionType.php:195]
#4 PhabricatorModularTransactionType::renderOldHandle() called at [<phorge>/src/applications/almanac/xaction/AlmanacInterfaceNetworkTransaction.php:20]
```

Closes T16506

Test Plan:
1. PHP 8.5
2. Go to http://phorge.localhost/almanac/network/edit/ and create some Network
3. Go to http://phorge.localhost/almanac/device/edit/form/default/
4. Enter a name, click "Create Device"
5. On resulting http://phorge.localhost/almanac/device/view/device2/ , click "Add Interface"
6. Select that Network, enter random stuff under "Address", enter a random number under "Port", click "Create Interface"
7. Go to http://phorge.localhost/feed/transactions/

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16506

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

+12 -5
+12 -5
src/applications/almanac/xaction/AlmanacInterfaceNetworkTransaction.php
··· 14 14 } 15 15 16 16 public function getTitle() { 17 - return pht( 18 - '%s changed the network for this interface from %s to %s.', 19 - $this->renderAuthor(), 20 - $this->renderOldHandle(), 21 - $this->renderNewHandle()); 17 + if (phutil_nonempty_string($this->getOldValue())) { 18 + return pht( 19 + '%s changed the network for this interface from %s to %s.', 20 + $this->renderAuthor(), 21 + $this->renderOldHandle(), 22 + $this->renderNewHandle()); 23 + } else { 24 + return pht( 25 + '%s set the network for this interface to %s.', 26 + $this->renderAuthor(), 27 + $this->renderNewHandle()); 28 + } 22 29 } 23 30 24 31 public function validateTransactions($object, array $xactions) {