Project

General

Profile

Actions

Bug #95802

open

Paginator does not respect initial limit or offset

Added by Georg Ringer about 3 years ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
-
Start date:
2021-10-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

If the paginator is used with an initial limit, that must be respected as well.

Given 20 records and setting $query->setLimit(10) and having 5 items per page, only 2 pages must be shown, currently the limit is completly ignored!


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #94965: QueryResultPaginator override current limit/offsetUnder Review2021-08-23

Actions
Actions #1

Updated by Georg Ringer almost 3 years ago

  • Subject changed from Paginator does not respect initial limit to Paginator does not respect initial limit or offset
Actions #3

Updated by Karel Kuijpers almost 3 years ago

The problem is in TYPO3\CMS\Extbase\Pagination\QueryResultPaginator. It overrides the original offset within the query of the items to be paginated. The method updatePaginatedItems should be updated as follows:
protected function updatePaginatedItems(int $limit, int $offset): void {
$origOffset=$this->paginatedQueryResult = $this->queryResult
>getQuery()>getOffset();

$this->paginatedQueryResult = $this->queryResult
->getQuery()
->setLimit($limit)
->setOffset($origOffset+$offset)
->execute();
}

I have tested it and it works perfectly for offset and limit

Actions #4

Updated by Benni Mack over 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #5

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80326

Actions #6

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80326

Actions #7

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80326

Actions #8

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80326

Actions #9

Updated by Stefan Bürk over 1 year ago

  • Related to Bug #94965: QueryResultPaginator override current limit/offset added
Actions #10

Updated by Georg Ringer 6 months ago

  • Status changed from Under Review to Closed

closed in favor of #94965

Actions #11

Updated by Gerrit Code Review about 1 month ago

  • Status changed from Closed to Under Review

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80326

Actions

Also available in: Atom PDF