From b85283105ecee83220e2b72b18b039370707a344 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Thu, 13 Nov 2014 16:54:33 -0800 Subject: [PATCH] Phriction - restore diff link Summary: Fixes T6472. I was curious to see how many reports we'd get but we didn't get any I know of... Still, this is a nice convenient link. Test Plan: edited a wiki doc title + body. ran /bin/mail to see the body and liked what I saw ```TEXT BODY btrahan changed the title from "new title is a good thing" to "new title is a good thing asdsadsadsadsada". btrahan edited the document content. DOCUMENT DIFF http://phalanx.dev/phriction/diff/36/?l=3&r=4 DOCUMENT DETAIL http://phalanx.dev/w/``` Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6472 Differential Revision: https://secure.phabricator.com/D10850 --- .../editor/PhrictionTransactionEditor.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/applications/phriction/editor/PhrictionTransactionEditor.php b/src/applications/phriction/editor/PhrictionTransactionEditor.php index d8c8bc1730..c5c6498b85 100644 --- a/src/applications/phriction/editor/PhrictionTransactionEditor.php +++ b/src/applications/phriction/editor/PhrictionTransactionEditor.php @@ -405,6 +405,24 @@ final class PhrictionTransactionEditor $body->addTextSection( pht('DOCUMENT CONTENT'), $object->getContent()->getContent()); + } else { + + foreach ($xactions as $xaction) { + switch ($xaction->getTransactionType()) { + case PhrictionTransaction::TYPE_CONTENT: + $diff_uri = id(new PhutilURI( + '/phriction/diff/'.$object->getID().'/')) + ->alter('l', $this->getOldContent()->getVersion()) + ->alter('r', $this->getNewContent()->getVersion()); + $body->addLinkSection( + pht('DOCUMENT DIFF'), + PhabricatorEnv::getProductionURI($diff_uri)); + break 2; + default: + break; + } + } + } $body->addLinkSection(