From 5f5346ed717e7445c71b43890cdad3687e0d497b Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 23 Sep 2020 19:29:10 +0200 Subject: [PATCH] Partial fix for #3840 --- app/Http/Controllers/SearchController.php | 1 + app/Support/Search/OperatorQuerySearch.php | 4 ++-- resources/views/v1/list/groups.twig | 2 +- resources/views/v1/search/search.twig | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 167ec697ad..8e180c7290 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -113,6 +113,7 @@ class SearchController extends Controller $parameters = ['search' => $fullQuery]; $url = route('search.index') . '?' . http_build_query($parameters); $groups->setPath($url); + try { $html = view('search.search', compact('groups', 'hasPages', 'searchTime'))->render(); // @codeCoverageIgnoreStart diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 5de672e51a..8629352fa2 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -246,11 +246,11 @@ class OperatorQuerySearch implements SearchInterface $value = $searchNode->getNode()->getValue(); // must be valid operator: if (in_array($operator, $this->validOperators, true)) { - if ($this->updateCollector($operator, $value)) { + if ($this->updateCollector($operator, (string) $value)) { $this->operators->push( [ 'type' => self::getRootOperator($operator), - 'value' => $value, + 'value' => (string) $value, ] ); } diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twig index 2be3b3f01b..1f5c1988ab 100644 --- a/resources/views/v1/list/groups.twig +++ b/resources/views/v1/list/groups.twig @@ -52,7 +52,7 @@ TODO: hide and show columns {% for group in groups %} - {% if group.count > 1 %} + {% if group.count() > 1 %} diff --git a/resources/views/v1/search/search.twig b/resources/views/v1/search/search.twig index 8141905359..c35bde96ae 100644 --- a/resources/views/v1/search/search.twig +++ b/resources/views/v1/search/search.twig @@ -1,6 +1,8 @@

- {% if hasPages %} + {% if true == hasPages %} {{ trans('firefly.search_found_more_transactions', {count: groups.count(), time: searchTime}) }} + {% elseif 0 == groups.count() %} + {{ trans_choice('firefly.search_found_transactions', 0, {time: searchTime}) }} {% else %} {{ trans_choice('firefly.search_found_transactions', groups.perPage(), {time: searchTime}) }} {% endif %}