mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Fix "Any Owner" and "No Owners" searches in Maniphest
Summary: See <https://discourse.phabricator-community.org/t/maniphest-home-page-crash-after-d19417/1445/3>. These special-token-only searches currently end up populating an empty `ownerPHIDs`, which fatals after the stricter check in D19417. Make the fatal on `withConstraint(array())` explicit and only set the PHID constraint if we have some PHIDs left. Test Plan: Searched for "No Owner", "Any Owner", an actual owner, "No Owner + actual user". Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D19440
This commit is contained in:
parent
d280b24239
commit
10a4b05ecb
1 changed files with 9 additions and 1 deletions
|
@ -73,6 +73,10 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
}
|
||||
|
||||
public function withOwners(array $owners) {
|
||||
if ($owners === array()) {
|
||||
throw new Exception(pht('Empty withOwners() constraint is not valid.'));
|
||||
}
|
||||
|
||||
$no_owner = PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN;
|
||||
$any_owner = PhabricatorPeopleAnyOwnerDatasource::FUNCTION_TOKEN;
|
||||
|
||||
|
@ -88,7 +92,11 @@ final class ManiphestTaskQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($owners) {
|
||||
$this->ownerPHIDs = $owners;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue