From b4effdf26c3e7d5de0d010cf14626c5d8d404e04 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 24 Mar 2017 16:58:48 -0700 Subject: [PATCH] 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 --- .../storage/PhabricatorApplicationTransaction.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index d2250b2b5d..5e36e942ce 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -932,7 +932,15 @@ abstract class PhabricatorApplicationTransaction $type = $this->getMetadata('edge:type'); $type = head($type); - $type_obj = PhabricatorEdgeType::getByConstant($type); + try { + $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) { return $type_obj->getTransactionEditString(