From c5639f7cea786c490221f34197c8c89290cadc7e Mon Sep 17 00:00:00 2001 From: Bertrand Dunogier Date: Wed, 27 Jan 2021 11:18:18 +0100 Subject: [PATCH] Re-introduced query type offset Any offset defined in the query type must be kept when computing offset for pagination. --- src/API/QueryFieldService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/API/QueryFieldService.php b/src/API/QueryFieldService.php index e9647c9..9dbedf9 100644 --- a/src/API/QueryFieldService.php +++ b/src/API/QueryFieldService.php @@ -86,7 +86,7 @@ public function countContentItemsForLocation(Location $location, string $fieldDe public function loadContentItemsSlice(Content $content, string $fieldDefinitionIdentifier, int $offset, int $limit): iterable { $query = $this->prepareQuery($content, $content->contentInfo->getMainLocation(), $fieldDefinitionIdentifier); - $query->offset = $offset; + $query->offset += $offset; $query->limit = $limit; return $this->executeQueryAndMapResult($query); @@ -95,7 +95,7 @@ public function loadContentItemsSlice(Content $content, string $fieldDefinitionI public function loadContentItemsSliceForLocation(Location $location, string $fieldDefinitionIdentifier, int $offset, int $limit): iterable { $query = $this->prepareQuery($location->getContent(), $location, $fieldDefinitionIdentifier); - $query->offset = $offset; + $query->offset += $offset; $query->limit = $limit; return $this->executeQueryAndMapResult($query);