From e4725832c4f7294fd8a5688f4d9d1a722285d652 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sat, 13 Jul 2013 10:33:32 -0700 Subject: [PATCH] Clean up some more carnage from D6416 Summary: rPad17c99c1b0222292a47ca79561a356cb8b5a5d5 stopped the fatal and this provides the forward fix. I think this is what a forward fix is anyway. Test Plan: viewed a revision (D63 is my boy) and no fatals Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6448 --- .../DifferentialRevisionViewController.php | 9 +++++---- .../view/DifferentialRevisionDetailView.php | 12 +++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 50766eaac3..16441a2ff9 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -223,10 +223,11 @@ final class DifferentialRevisionViewController extends DifferentialController { $visible_changesets = $changesets; } - $revision_detail = new DifferentialRevisionDetailView(); - $revision_detail->setRevision($revision); - $revision_detail->setDiff(end($diffs)); - $revision_detail->setAuxiliaryFields($aux_fields); + $revision_detail = id(new DifferentialRevisionDetailView()) + ->setRevision($revision) + ->setDiff(end($diffs)) + ->setAuxiliaryFields($aux_fields) + ->setURI($request->getRequestURI()); $actions = $this->getRevisionActions($revision); diff --git a/src/applications/differential/view/DifferentialRevisionDetailView.php b/src/applications/differential/view/DifferentialRevisionDetailView.php index 364fe796a1..e47e071150 100644 --- a/src/applications/differential/view/DifferentialRevisionDetailView.php +++ b/src/applications/differential/view/DifferentialRevisionDetailView.php @@ -6,6 +6,15 @@ final class DifferentialRevisionDetailView extends AphrontView { private $actions; private $auxiliaryFields = array(); private $diff; + private $uri; + + public function setURI($uri) { + $this->uri = $uri; + return $this; + } + public function getURI() { + return $this->uri; + } public function setDiff(DifferentialDiff $diff) { $this->diff = $diff; @@ -45,7 +54,8 @@ final class DifferentialRevisionDetailView extends AphrontView { $actions = id(new PhabricatorActionListView()) ->setUser($user) - ->setObject($revision); + ->setObject($revision) + ->setObjectURI($this->getURI()); foreach ($this->getActions() as $action) { $obj = id(new PhabricatorActionView()) ->setIcon(idx($action, 'icon', 'edit'))