From 014a41d9d7d0eeb2413893774e39546546395303 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Thu, 12 Dec 2024 12:42:22 +0100 Subject: [PATCH] [Pagerfanta] Fixed LSE total count regression when there's no count to perform --- src/lib/Search/Legacy/Content/Handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Search/Legacy/Content/Handler.php b/src/lib/Search/Legacy/Content/Handler.php index 4a18958283..ccf685cce0 100644 --- a/src/lib/Search/Legacy/Content/Handler.php +++ b/src/lib/Search/Legacy/Content/Handler.php @@ -142,7 +142,7 @@ public function findContent(Query $query, array $languageFilter = []): SearchRes /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult<\Ibexa\Contracts\Core\Persistence\Content\ContentInfo> $result */ $result = new SearchResult(); $result->time = (int) (microtime(true) - $start) * 1000; // time expressed in ms - $result->totalCount = $data['count'] !== null ? (int)$data['count'] : 0; + $result->totalCount = $data['count'] !== null ? (int)$data['count'] : null; $contentInfoList = $this->contentMapper->extractContentInfoFromRows( $data['rows'], '', @@ -228,7 +228,7 @@ public function findLocations(LocationQuery $query, array $languageFilter = []): /** @phpstan-var \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult<\Ibexa\Contracts\Core\Persistence\Content\Location> $result */ $result = new SearchResult(); $result->time = (int) (microtime(true) - $start) * 1000; // time expressed in ms - $result->totalCount = $data['count'] !== null ? (int)$data['count'] : 0; + $result->totalCount = $data['count'] !== null ? (int)$data['count'] : null; $locationList = $this->locationMapper->createLocationsFromRows($data['rows']); foreach ($locationList as $index => $location) {