From 52de3c9cf7fb6a73db5ca844529b82e39e1b94cc Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 31 Mar 2013 12:30:06 -0700 Subject: [PATCH] Fix pager for tokens given Summary: Several small bugs here, I just never tested this properly. Test Plan: Set page size to 2, paged through tokens given. Reviewers: blc, btrahan, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5500 --- .../tokens/controller/PhabricatorTokenGivenController.php | 5 ++--- src/applications/tokens/query/PhabricatorTokenGivenQuery.php | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/applications/tokens/controller/PhabricatorTokenGivenController.php b/src/applications/tokens/controller/PhabricatorTokenGivenController.php index b44985fc7c..7968a0563c 100644 --- a/src/applications/tokens/controller/PhabricatorTokenGivenController.php +++ b/src/applications/tokens/controller/PhabricatorTokenGivenController.php @@ -7,11 +7,10 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController { $user = $request->getUser(); $pager = id(new AphrontCursorPagerView()) - ->setURI(new PhutilURI($this->getApplicationURI('/given/'))); + ->readFromRequest($request); $tokens_given = id(new PhabricatorTokenGivenQuery()) ->setViewer($user) - ->setLimit(100) ->executeWithCursorPager($pager); $handles = array(); @@ -53,6 +52,7 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController { $list->addItem($item); } + $list->setPager($pager); $title = pht('Tokens Given'); @@ -65,7 +65,6 @@ final class PhabricatorTokenGivenController extends PhabricatorTokenController { $nav->selectFilter('given/'); $nav->appendChild($list); - $nav->appendChild($pager); return $this->buildApplicationPage( $nav, diff --git a/src/applications/tokens/query/PhabricatorTokenGivenQuery.php b/src/applications/tokens/query/PhabricatorTokenGivenQuery.php index 1c71589215..6adbdac332 100644 --- a/src/applications/tokens/query/PhabricatorTokenGivenQuery.php +++ b/src/applications/tokens/query/PhabricatorTokenGivenQuery.php @@ -61,6 +61,8 @@ final class PhabricatorTokenGivenQuery $this->tokenPHIDs); } + $where[] = $this->buildPagingClause($conn_r); + return $this->formatWhereClause($where); }