Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/8390

James Cole925450f84c6f
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) {