1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +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:
Austin McKinley 2019-07-04 16:00:16 -07:00
parent 45f4211541
commit 3c43222525

View file

@ -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,