@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+16 -24
+16 -24
src/applications/project/query/PhabricatorProjectColumnQuery.php
··· 28 28 return $this; 29 29 } 30 30 31 - protected function loadPage() { 32 - $table = new PhabricatorProjectColumn(); 33 - $conn_r = $table->establishConnection('r'); 34 - 35 - $data = queryfx_all( 36 - $conn_r, 37 - 'SELECT * FROM %T %Q %Q %Q', 38 - $table->getTableName(), 39 - $this->buildWhereClause($conn_r), 40 - $this->buildOrderClause($conn_r), 41 - $this->buildLimitClause($conn_r)); 31 + public function newResultObject() { 32 + return new PhabricatorProjectColumn(); 33 + } 42 34 43 - return $table->loadAllFromArray($data); 35 + protected function loadPage() { 36 + return $this->loadStandardPage($this->newResultObject()); 44 37 } 45 38 46 39 protected function willFilterPage(array $page) { ··· 60 53 $phid = $column->getProjectPHID(); 61 54 $project = idx($projects, $phid); 62 55 if (!$project) { 56 + $this->didRejectResult($page[$key]); 63 57 unset($page[$key]); 64 58 continue; 65 59 } ··· 69 63 return $page; 70 64 } 71 65 72 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 73 - $where = array(); 66 + protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 67 + $where = parent::buildWhereClauseParts($conn); 74 68 75 - if ($this->ids) { 69 + if ($this->ids !== null) { 76 70 $where[] = qsprintf( 77 - $conn_r, 71 + $conn, 78 72 'id IN (%Ld)', 79 73 $this->ids); 80 74 } 81 75 82 - if ($this->phids) { 76 + if ($this->phids !== null) { 83 77 $where[] = qsprintf( 84 - $conn_r, 78 + $conn, 85 79 'phid IN (%Ls)', 86 80 $this->phids); 87 81 } 88 82 89 - if ($this->projectPHIDs) { 83 + if ($this->projectPHIDs !== null) { 90 84 $where[] = qsprintf( 91 - $conn_r, 85 + $conn, 92 86 'projectPHID IN (%Ls)', 93 87 $this->projectPHIDs); 94 88 } 95 89 96 90 if ($this->statuses !== null) { 97 91 $where[] = qsprintf( 98 - $conn_r, 92 + $conn, 99 93 'status IN (%Ld)', 100 94 $this->statuses); 101 95 } 102 96 103 - $where[] = $this->buildPagingClause($conn_r); 104 - 105 - return $this->formatWhereClause($where); 97 + return $where; 106 98 } 107 99 108 100 public function getQueryApplicationClass() {