From 2f32aebf6fc21d682721316d88d7d17ff72321bf Mon Sep 17 00:00:00 2001 From: Nick Harper Date: Thu, 20 Dec 2012 12:24:34 -0800 Subject: [PATCH] Fix paste Summary: The caching introduced by rP7e37eb48273eef87e6e6811703fb5d85a3e07a81 broke the use of PhabricatorPaste::getContent() for forking/editing pastes and downloading pastes with arc paste. I think this fixes all the appropriate callsites. Test Plan: fork a paste in the web ui Reviewers: vrana, epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4244 --- src/applications/paste/conduit/ConduitAPI_paste_Method.php | 2 +- .../paste/controller/PhabricatorPasteEditController.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/applications/paste/conduit/ConduitAPI_paste_Method.php b/src/applications/paste/conduit/ConduitAPI_paste_Method.php index 830135d567..a92857bef8 100644 --- a/src/applications/paste/conduit/ConduitAPI_paste_Method.php +++ b/src/applications/paste/conduit/ConduitAPI_paste_Method.php @@ -17,7 +17,7 @@ abstract class ConduitAPI_paste_Method extends ConduitAPIMethod { 'language' => $paste->getLanguage(), 'uri' => PhabricatorEnv::getProductionURI('/P'.$paste->getID()), 'parentPHID' => $paste->getParentPHID(), - 'content' => $paste->getContent(), + 'content' => $paste->getRawContent(), ); } diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php index f5ff7ed17b..1d3e8515b8 100644 --- a/src/applications/paste/controller/PhabricatorPasteEditController.php +++ b/src/applications/paste/controller/PhabricatorPasteEditController.php @@ -28,6 +28,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { ->setViewer($user) ->withIDs(array($parent_id)) ->needContent(true) + ->needRawContent(true) ->execute(); $parent = head($parent); @@ -95,7 +96,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { if ($is_create && $parent) { $paste->setTitle('Fork of '.$parent->getFullName()); $paste->setLanguage($parent->getLanguage()); - $text = $parent->getContent(); + $text = $parent->getRawContent(); } }