1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

Fix a rendering fatal for unknown edge constants

If we try to render an edge transaction which uses unknown edge constants,
it turns out we fatal. Degrade instead. This happened when viewing very old
badges.

Auditors: chad
This commit is contained in:
epriestley 2017-03-24 16:58:48 -07:00
parent 186460888d
commit b4effdf26c

View file

@ -932,7 +932,15 @@ abstract class PhabricatorApplicationTransaction
$type = $this->getMetadata('edge:type'); $type = $this->getMetadata('edge:type');
$type = head($type); $type = head($type);
try {
$type_obj = PhabricatorEdgeType::getByConstant($type); $type_obj = PhabricatorEdgeType::getByConstant($type);
} catch (Exception $ex) {
// Recover somewhat gracefully from edge transactions which
// we don't have the classes for.
return pht(
'%s edited an edge.',
$this->renderHandleLink($author_phid));
}
if ($add && $rem) { if ($add && $rem) {
return $type_obj->getTransactionEditString( return $type_obj->getTransactionEditString(