From 93e1978e054800781c55b96a09645de2b34277da Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 24 Sep 2014 12:09:59 -0700 Subject: [PATCH] Support - Differential - fix rendering feed story where you removed a repository Summary: Fixes T6176. Language here is a bit awkard but I wanted to use the verb "removed" *and* still have the object first, so I ended up adding the before details parenthetically. Test Plan: story no longer fatal'd in my feed Reviewers: epriestley, chad Reviewed By: chad Subscribers: epriestley, Korvin Maniphest Tasks: T6176 Differential Revision: https://secure.phabricator.com/D10549 --- .../customfield/DifferentialRepositoryField.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/applications/differential/customfield/DifferentialRepositoryField.php b/src/applications/differential/customfield/DifferentialRepositoryField.php index cab25dbbe5..06ada847c9 100644 --- a/src/applications/differential/customfield/DifferentialRepositoryField.php +++ b/src/applications/differential/customfield/DifferentialRepositoryField.php @@ -107,19 +107,25 @@ final class DifferentialRepositoryField $old = $xaction->getOldValue(); $new = $xaction->getNewValue(); - if ($old) { + if ($old && $new) { return pht( '%s updated the repository for %s from %s to %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid), $xaction->renderHandleLink($old), $xaction->renderHandleLink($new)); - } else { + } else if ($new) { return pht( '%s set the repository for %s to %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid), $xaction->renderHandleLink($new)); + } else { + return pht( + '%s removed the repository for %s. (Repository was %s.)', + $xaction->renderHandleLink($author_phid), + $xaction->renderHandleLink($object_phid), + $xaction->renderHandleLink($old)); } }