mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix paging fatal with flagged objects
Summary: Fixes T13331. Just adds a generic `withIDs()` method to `PhabricatorFlagQuery`. Test Plan: Flagged > 100 objects, observed fatal attempting to page. Next page loads as expected after fix. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T13331 Differential Revision: https://secure.phabricator.com/D20642
This commit is contained in:
parent
45f4211541
commit
3c43222525
1 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,7 @@ final class PhabricatorFlagQuery
|
|||
const GROUP_COLOR = 'color';
|
||||
const GROUP_NONE = 'none';
|
||||
|
||||
private $ids;
|
||||
private $ownerPHIDs;
|
||||
private $types;
|
||||
private $objectPHIDs;
|
||||
|
@ -15,6 +16,11 @@ final class PhabricatorFlagQuery
|
|||
private $needHandles;
|
||||
private $needObjects;
|
||||
|
||||
public function withIDs(array $ids) {
|
||||
$this->ids = $ids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withOwnerPHIDs(array $owner_phids) {
|
||||
$this->ownerPHIDs = $owner_phids;
|
||||
return $this;
|
||||
|
@ -126,6 +132,13 @@ final class PhabricatorFlagQuery
|
|||
protected function buildWhereClause(AphrontDatabaseConnection $conn) {
|
||||
$where = array();
|
||||
|
||||
if ($this->ids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'flag.id IN (%Ld)',
|
||||
$this->ids);
|
||||
}
|
||||
|
||||
if ($this->ownerPHIDs) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
|
|
Loading…
Reference in a new issue