Page MenuHomePhorge

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

Authored by aklapper on Jun 19 2024, 20:33.

Details

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.

Diff Detail

Repository
rP Phorge
Branch
T15860heraldUnknownObjectCustomSelect (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1355
Build 1355: arc lint + arc unit

Event Timeline

This is not a full fix, still it is an improvement (and a base if anyone feels like fixing this perfectly).

Before:

Screenshot from 2024-06-19 22-27-59.png (884×950 px, 109 KB)

After:

Screenshot from 2024-06-19 22-27-26.png (884×950 px, 107 KB)

Maybe relevant but PhabricatorObjectHandleData seems to do some magic about filling PhabricatorObjectHandle with stuff like the name.

Maybe relevant but PhabricatorObjectHandleData seems to do some magic

Not anymore since rPb902005bed52a5e35c7011c70fbe42621598713f but thanks for making me look into this again. :P

Using PhabricatorHandleQuery would just have the same result as current return $this->getPHID(). And using PhabricatorObjectQuery gets us nothing.
Getting the "proper" field value would require HeraldField::getHeraldFieldValueType($condition)->renderFieldValue($value) but as I wrote in the source comment, we are only dealing on text, no object.

This revision was not accepted when it landed; it landed in state Changes Planned.Thu, Nov 28, 11:41
This revision was automatically updated to reflect the committed changes.