1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00: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) {
$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) {
foreach ($value as $key => $phid) {
$handle = idx($handles, $phid);
@ -191,16 +199,23 @@ final class HeraldTranscriptController extends HeraldController {
$condition_xscripts);
}
foreach ($condition_xscripts as $condition_xscript) {
$value = $condition_xscript->getTestValue();
// TODO: Also total hacks.
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;
switch ($condition_xscript->getFieldName()) {
case HeraldAdapter::FIELD_RULE:
$phids[] = $condition_xscript->getTestValue();
break;
default:
$value = $condition_xscript->getTestValue();
// TODO: Also total hacks.
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;
}
}