From dfa15726ea5afec47e5062a1feaf2ef0cd75c8ea Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 5 Nov 2023 15:36:10 +0100 Subject: [PATCH] Fix cursor paging issue in Given Token query call Summary: The "Query" class for Given Token is missing a "withIDs()" method. `Call to undefined method PhabricatorTokenGivenQuery::withIDs() at [PhabricatorCursorPagedPolicyAwareQuery.php:120]` Closes T15652 Test Plan: Go to the Token page and pass a URL parameter, such as `/token/given/?after=3` Reviewers: O1 Blessed Committers, speck Reviewed By: O1 Blessed Committers, speck Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15652 Differential Revision: https://we.phorge.it/D25455 --- .../tokens/query/PhabricatorTokenGivenQuery.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/applications/tokens/query/PhabricatorTokenGivenQuery.php b/src/applications/tokens/query/PhabricatorTokenGivenQuery.php index 0e6ad9eb54..14e8016cf1 100644 --- a/src/applications/tokens/query/PhabricatorTokenGivenQuery.php +++ b/src/applications/tokens/query/PhabricatorTokenGivenQuery.php @@ -3,10 +3,16 @@ final class PhabricatorTokenGivenQuery extends PhabricatorCursorPagedPolicyAwareQuery { + private $ids; private $authorPHIDs; private $objectPHIDs; private $tokenPHIDs; + public function withIDs(array $ids) { + $this->ids = $ids; + return $this; + } + public function withTokenPHIDs(array $token_phids) { $this->tokenPHIDs = $token_phids; return $this; @@ -29,6 +35,13 @@ final class PhabricatorTokenGivenQuery protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { $where = parent::buildWhereClauseParts($conn); + if ($this->ids !== null) { + $where[] = qsprintf( + $conn, + 'id IN (%Ld)', + $this->ids); + } + if ($this->authorPHIDs !== null) { $where[] = qsprintf( $conn, -- 2.51.2