James Cole
2024-01-14 13:59:09 +01:00
parent 62f59c6a19
commit 925450f84c

View File

@@ -1949,12 +1949,17 @@ class OperatorQuerySearch implements SearchInterface
// get accounts: // get accounts:
$accounts = $this->accountRepository->searchAccount($value, $searchTypes, 1337); $accounts = $this->accountRepository->searchAccount($value, $searchTypes, 1337);
if (0 === $accounts->count()) { if (0 === $accounts->count() && false === $prohibited) {
app('log')->debug('Found zero accounts, search for non existing account, NO results will be returned.'); app('log')->debug('Found zero accounts, search for non existing account, NO results will be returned.');
$this->collector->findNothing(); $this->collector->findNothing();
return; return;
} }
if (0 === $accounts->count() && true === $prohibited) {
app('log')->debug('Found zero accounts, but the search is negated, so effectively we ignore the search parameter.');
return;
}
app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count())); app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
$filtered = $accounts->filter( $filtered = $accounts->filter(
static function (Account $account) use ($value, $stringMethod) { static function (Account $account) use ($value, $stringMethod) {