1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-28 20:18:13 +01:00

Don't apply space constraints to omnipotent-viewer queries

Summary:
Fixes T8743. Fixes T8746. When running queries with the omnipotent viewer and no explicit space constraints, don't add implicit space constraints.

This prevents us from fataling when running older pre-space migrations and trying to load space-aware objects.

Test Plan: Manually ran migrations with `--trace`, verified no `WHERE spacePHID = ...`.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: eadler, epriestley

Maniphest Tasks: T8743, T8746

Differential Revision: https://secure.phabricator.com/D13542
This commit is contained in:
epriestley 2015-07-03 10:59:48 -07:00
parent a7cfc58353
commit 92b73fed6b

View file

@ -1763,6 +1763,16 @@ abstract class PhabricatorCursorPagedPolicyAwareQuery
$viewer = $this->getViewer();
// If we have an omnipotent viewer and no formal space constraints, don't
// emit a clause. This primarily enables older migrations to run cleanly,
// without fataling because they try to match a `spacePHID` column which
// does not exist yet. See T8743, T8746.
if ($viewer->isOmnipotent()) {
if ($this->spaceIsArchived === null && $this->spacePHIDs === null) {
return null;
}
}
$space_phids = array();
$include_null = false;