Fix zero length limit.

This commit is contained in:
James Cole 2020-10-23 12:33:53 +02:00
parent 171f8c5848
commit bcdc562bf7
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
2 changed files with 4 additions and 2 deletions

View File

@ -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);
}

View File

@ -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();
}