Skip to content

Firefly III: a personal finances manager

Fix zero length limit.

James Colebcdc562bf7f5
diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php
index 612f3d0049..cf20585286 100644
--- a/app/Helpers/Collector/GroupCollector.php
+++ b/app/Helpers/Collector/GroupCollector.php
@@ -190,7 +190,9 @@ class GroupCollector implements GroupCollectorInterface
public function getPaginatedGroups(): LengthAwarePaginator
{
$set = $this->getGroups();
-
+ if(0===$this->limit) {
+ $this->setLimit(50);
+ }
return new LengthAwarePaginator($set, $this->total, $this->limit, $this->page);
}
diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php
index 1f6ee522b0..446217f028 100644
--- a/app/Support/Search/OperatorQuerySearch.php
+++ b/app/Support/Search/OperatorQuerySearch.php
@@ -192,7 +192,7 @@ class OperatorQuerySearch implements SearchInterface
public function searchTransactions(): LengthAwarePaginator
{
if (0 === count($this->getWords()) && 0 === count($this->getOperators())) {
- throw new FireflyException('Search query is empty.');
+ return new LengthAwarePaginator;
}
return $this->collector->getPaginatedGroups();
}