1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 09:58:24 +01:00

Use didRejectResult() when querying workboard columns

Summary: Fixes T9250. Ref T4345.

Test Plan:
Faked a policy error:

{F748975}

Reviewers: joshuaspence, chad

Reviewed By: chad

Maniphest Tasks: T4345, T9250

Differential Revision: https://secure.phabricator.com/D13981
This commit is contained in:
epriestley 2015-08-23 08:31:53 -07:00
parent 459e0d2fa3
commit 9e3f3e692d

View file

@ -28,19 +28,12 @@ final class PhabricatorProjectColumnQuery
return $this;
}
public function newResultObject() {
return new PhabricatorProjectColumn();
}
protected function loadPage() {
$table = new PhabricatorProjectColumn();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(
$conn_r,
'SELECT * FROM %T %Q %Q %Q',
$table->getTableName(),
$this->buildWhereClause($conn_r),
$this->buildOrderClause($conn_r),
$this->buildLimitClause($conn_r));
return $table->loadAllFromArray($data);
return $this->loadStandardPage($this->newResultObject());
}
protected function willFilterPage(array $page) {
@ -60,6 +53,7 @@ final class PhabricatorProjectColumnQuery
$phid = $column->getProjectPHID();
$project = idx($projects, $phid);
if (!$project) {
$this->didRejectResult($page[$key]);
unset($page[$key]);
continue;
}
@ -69,40 +63,38 @@ final class PhabricatorProjectColumnQuery
return $page;
}
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array();
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
$where = parent::buildWhereClauseParts($conn);
if ($this->ids) {
if ($this->ids !== null) {
$where[] = qsprintf(
$conn_r,
$conn,
'id IN (%Ld)',
$this->ids);
}
if ($this->phids) {
if ($this->phids !== null) {
$where[] = qsprintf(
$conn_r,
$conn,
'phid IN (%Ls)',
$this->phids);
}
if ($this->projectPHIDs) {
if ($this->projectPHIDs !== null) {
$where[] = qsprintf(
$conn_r,
$conn,
'projectPHID IN (%Ls)',
$this->projectPHIDs);
}
if ($this->statuses !== null) {
$where[] = qsprintf(
$conn_r,
$conn,
'status IN (%Ld)',
$this->statuses);
}
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);
return $where;
}
public function getQueryApplicationClass() {