mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix transaction queries failing on "withIDs()" after clicking "Show Older"
Summary: See <https://discourse.phabricator-community.org/t/unhandled-exception-on-show-older-changes/2545/>. Before T13266, this query got away without having real paging because it used simple ID paging only and results are never actually hidden (today, you can always see all transactions on an object). Provide `withIDs()` so the new, slightly stricter paging works. Test Plan: On an object with "Show Older" in the transaction record, clicked the link. Before: exception in paging code (see Discourse link above). After: transactions loaded cleanly. Reviewers: amckinley, avivey Reviewed By: avivey Differential Revision: https://secure.phabricator.com/D20317
This commit is contained in:
parent
f0ae75c991
commit
b825570734
1 changed files with 13 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
abstract class PhabricatorApplicationTransactionQuery
|
abstract class PhabricatorApplicationTransactionQuery
|
||||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||||
|
|
||||||
|
private $ids;
|
||||||
private $phids;
|
private $phids;
|
||||||
private $objectPHIDs;
|
private $objectPHIDs;
|
||||||
private $authorPHIDs;
|
private $authorPHIDs;
|
||||||
|
@ -35,6 +36,11 @@ abstract class PhabricatorApplicationTransactionQuery
|
||||||
|
|
||||||
abstract public function getTemplateApplicationTransaction();
|
abstract public function getTemplateApplicationTransaction();
|
||||||
|
|
||||||
|
public function withIDs(array $ids) {
|
||||||
|
$this->ids = $ids;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function withPHIDs(array $phids) {
|
public function withPHIDs(array $phids) {
|
||||||
$this->phids = $phids;
|
$this->phids = $phids;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -157,6 +163,13 @@ abstract class PhabricatorApplicationTransactionQuery
|
||||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||||||
$where = parent::buildWhereClauseParts($conn);
|
$where = parent::buildWhereClauseParts($conn);
|
||||||
|
|
||||||
|
if ($this->ids !== null) {
|
||||||
|
$where[] = qsprintf(
|
||||||
|
$conn,
|
||||||
|
'x.id IN (%Ld)',
|
||||||
|
$this->ids);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->phids !== null) {
|
if ($this->phids !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
|
|
Loading…
Reference in a new issue