From 612a93229fa3004c0a1f1da3e1d4155aa544dd20 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 6 May 2016 12:36:48 -0700 Subject: [PATCH] Fix some pagination/redirect issues for repositories Summary: Ref T10923. Paging wasn't being applied correctly when creating //new// repositories after API changes. Also, the first redirect after creation wasn't sending users to the right place. Test Plan: - Created a new repostiory, got redirected properly. - Verified that new repostiory flow has the correct fields (name, callsign, etc) and Conduit API has the correct fields (everything). Reviewers: chad Reviewed By: chad Maniphest Tasks: T10923 Differential Revision: https://secure.phabricator.com/D15865 --- .../transactions/editengine/PhabricatorEditEngine.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php index 2c283a27f3..1717b2cc7a 100644 --- a/src/applications/transactions/editengine/PhabricatorEditEngine.php +++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php @@ -497,6 +497,10 @@ abstract class PhabricatorEditEngine } public function getEffectiveObjectViewURI($object) { + if ($this->getIsCreate()) { + return $this->getObjectViewURI($object); + } + $page = $this->getSelectedPage(); if ($page) { $view_uri = $page->getViewURI(); @@ -839,6 +843,13 @@ abstract class PhabricatorEditEngine } $page_key = $request->getURIData('pageKey'); + if (!strlen($page_key)) { + $pages = $this->getPages($object); + if ($pages) { + $page_key = head_key($pages); + } + } + if (strlen($page_key)) { $page = $this->selectPage($object, $page_key); if (!$page) {