@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.

Raise a tailored error when calling "transaction.search" with empty "phids" constraint

Summary:
Ref T13164. See PHI725. For real "*.search" methods, parameters get validated and you get an error if you use an empty list as a constraint.

Since "transaction.search" isn't really a normal "*.search" method, it doesn't benefit from this. Just do the check manually for now.

Test Plan: Made `transaction.search` calls with no constraints (got results); a valid costraint (got fewer results); and an invalid empty constraint (got an exception).

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19562

+8
+8
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
··· 79 79 )); 80 80 81 81 $with_phids = idx($constraints, 'phids'); 82 + 83 + if ($with_phids === array()) { 84 + throw new Exception( 85 + pht( 86 + 'Constraint "phids" to "transaction.search" requires nonempty list, '. 87 + 'empty list provided.')); 88 + } 89 + 82 90 if ($with_phids) { 83 91 $xaction_query->withPHIDs($with_phids); 84 92 }