From 925450f84c6fc3a58a523ac5ee470d67a26676c3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 14 Jan 2024 13:59:09 +0100 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/8390 --- app/Support/Search/OperatorQuerySearch.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index aef75bb722..ec77c69dc5 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -1949,12 +1949,17 @@ class OperatorQuerySearch implements SearchInterface // get accounts: $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.'); $this->collector->findNothing(); 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())); $filtered = $accounts->filter( static function (Account $account) use ($value, $stringMethod) {