diff --git a/src/applications/differential/controller/DifferentialRevisionEditController.php b/src/applications/differential/controller/DifferentialRevisionEditController.php index f7077b750f..0ff3708586 100644 --- a/src/applications/differential/controller/DifferentialRevisionEditController.php +++ b/src/applications/differential/controller/DifferentialRevisionEditController.php @@ -20,15 +20,17 @@ final class DifferentialRevisionEditController extends DifferentialController { $revision = id(new DifferentialRevisionQuery()) ->setViewer($viewer) ->withIDs(array($this->id)) + ->needRelationships(true) + ->needReviewerStatus(true) ->executeOne(); if (!$revision) { return new Aphront404Response(); } } else { $revision = new DifferentialRevision(); + $revision->attachRelationships(array()); } - $revision->loadRelationships(); $aux_fields = $this->loadAuxiliaryFields($revision); $diff_id = $request->getInt('diffID'); diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 16441a2ff9..8ce7b19029 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -18,13 +18,17 @@ final class DifferentialRevisionViewController extends DifferentialController { $user = $request->getUser(); $viewer_is_anonymous = !$user->isLoggedIn(); - $revision = id(new DifferentialRevision())->load($this->revisionID); + $revision = id(new DifferentialRevisionQuery()) + ->withIDs(array($this->revisionID)) + ->setViewer($request->getUser()) + ->needRelationships(true) + ->needReviewerStatus(true) + ->executeOne(); + if (!$revision) { return new Aphront404Response(); } - $revision->loadRelationships(); - $diffs = $revision->loadDiffs(); if (!$diffs) { diff --git a/src/applications/differential/controller/DifferentialSubscribeController.php b/src/applications/differential/controller/DifferentialSubscribeController.php index 99fc019c3a..10c2d9b834 100644 --- a/src/applications/differential/controller/DifferentialSubscribeController.php +++ b/src/applications/differential/controller/DifferentialSubscribeController.php @@ -15,7 +15,12 @@ final class DifferentialSubscribeController extends DifferentialController { $request = $this->getRequest(); $user = $request->getUser(); - $revision = id(new DifferentialRevision())->load($this->id); + $revision = id(new DifferentialRevisionQuery()) + ->withIDs(array($this->id)) + ->setViewer($request->getUser()) + ->needRelationships(true) + ->needReviewerStatus(true) + ->executeOne(); if (!$revision) { return new Aphront404Response(); } @@ -51,7 +56,6 @@ final class DifferentialSubscribeController extends DifferentialController { return id(new AphrontDialogResponse())->setDialog($dialog); } - $revision->loadRelationships(); $phid = $user->getPHID(); switch ($this->action) {