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

Avoid "Unknown Object (????)" for custom Select field values in Herald editor

Summary:
Custom Select field values are rendered as `Unknown Object (????)` when set as Herald rule conditions and editing the Herald rule.
This is unhelpful; at least display their key value.

Closes T15860

Test Plan: Create a `"type": "select"` custom field via `/config/edit/maniphest.custom-field-definitions/`, set up a Herald rule with a condition based on that custom field, edit the Herald rule.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15860

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

+13
+13
src/applications/phid/PhabricatorObjectHandle.php
··· 168 168 if ($this->name === null) { 169 169 if ($this->getPolicyFiltered()) { 170 170 return pht('Restricted %s', $this->getTypeName()); 171 + } else if ($this->getPHID() && $this->getTypeName() === 172 + PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN) { 173 + // Values of custom Select field conditions in Herald rules do not have 174 + // a PHID (and no PHID type) as they are arbitrary text when loadPage() 175 + // in PhabricatorHandleQuery calls $type = phid_get_type($phid). 176 + // Thus the code lower in this class cannot pull a name to render for 177 + // these non-existing PHIDs either. 178 + // In this case, render their PHID (the actual Select field key value). 179 + // This is always more informative than 'Unknown Object (????)' though 180 + // still imperfect as it displays the key instead of the user-friendly 181 + // name value defined in maniphest.custom-field-definitions. 182 + // https://we.phorge.it/T15860 183 + return $this->getPHID(); 171 184 } else { 172 185 return pht('Unknown Object (%s)', $this->getTypeName()); 173 186 }