Page MenuHomePhorge

D25696.1736610111.diff
No OneTemporary

D25696.1736610111.diff

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

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 11, 15:41 (6 d, 7 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1110517
Default Alt Text
D25696.1736610111.diff (1 KB)

Event Timeline