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

Fix PHP 8.1 "class_exists(null)" exception on PhabricatorStandardSelectCustomFieldDatasource

Summary:
Throw a less cryptic exception when no (required) class parameter is passed to `PhabricatorStandardSelectCustomFieldDatasource`.

```
ERROR 8192: class_exists(): Passing null to parameter #1 ($class) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/customfield/datasource/PhabricatorStandardSelectCustomFieldDatasource.php:22]

EXCEPTION: (Exception) Custom field class "" does not exist. at [<phorge>/src/infrastructure/customfield/datasource/PhabricatorStandardSelectCustomFieldDatasource.php:23]
```

Closes T16298

Test Plan:
* Go to http://phorge.localhost/typeahead/class/?class=PhabricatorStandardSelectCustomFieldDatasource
* Get a more helpful exception `"You must set a custom field class!"`

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16298

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

+4
+4
src/infrastructure/customfield/datasource/PhabricatorStandardSelectCustomFieldDatasource.php
··· 19 19 $viewer = $this->getViewer(); 20 20 21 21 $class = $this->getParameter('object'); 22 + if (!$class) { 23 + throw new Exception( 24 + pht('You must set a custom field class!')); 25 + } 22 26 if (!class_exists($class)) { 23 27 throw new Exception( 24 28 pht(