1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

Herald - print out rule monogram rather than rule phid on transcript controller

Summary: Fixes T4632.

Test Plan: viewed a transcript for rule x which depends on rule y and noted "rule y" printed out rather than "PHID-BLAH-BLAH"

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4632

Differential Revision: https://secure.phabricator.com/D8678
This commit is contained in:
Bob Trahan 2014-04-02 11:59:50 -07:00
parent 69b8f56cda
commit b50426a98f

View file

@ -112,7 +112,15 @@ final class HeraldTranscriptController extends HeraldController {
} }
protected function renderConditionTestValue($condition, $handles) { protected function renderConditionTestValue($condition, $handles) {
$value = $condition->getTestValue(); switch ($condition->getFieldName()) {
case HeraldAdapter::FIELD_RULE:
$value = array($condition->getTestValue());
break;
default:
$value = $condition->getTestValue();
break;
}
if (!is_scalar($value) && $value !== null) { if (!is_scalar($value) && $value !== null) {
foreach ($value as $key => $phid) { foreach ($value as $key => $phid) {
$handle = idx($handles, $phid); $handle = idx($handles, $phid);
@ -191,16 +199,23 @@ final class HeraldTranscriptController extends HeraldController {
$condition_xscripts); $condition_xscripts);
} }
foreach ($condition_xscripts as $condition_xscript) { foreach ($condition_xscripts as $condition_xscript) {
$value = $condition_xscript->getTestValue(); switch ($condition_xscript->getFieldName()) {
// TODO: Also total hacks. case HeraldAdapter::FIELD_RULE:
if (is_array($value)) { $phids[] = $condition_xscript->getTestValue();
foreach ($value as $phid) { break;
if ($phid) { // TODO: Probably need to make sure this "looks like" a default:
// PHID or decrease the level of hacks here; this used $value = $condition_xscript->getTestValue();
// to be an is_numeric() check in Facebook land. // TODO: Also total hacks.
$phids[] = $phid; if (is_array($value)) {
foreach ($value as $phid) {
if ($phid) { // TODO: Probably need to make sure this
// "looks like" a PHID or decrease the level of hacks here;
// this used to be an is_numeric() check in Facebook land.
$phids[] = $phid;
}
}
} }
} break;
} }
} }