#94965QueryResultPaginator override current limit/offset
Description
Hi,
If I use the `QueryResultPaginator` with a `QueryResult` who has already a limit and/or an offset they are all overrided.
The correct behaviour has to take care of the current state of the `QueryResult` and paginate only the result without overriding the query.
Thanks,
Eric
Reviews 1
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch
- Commit message
-
[BUGFIX] QueryResultPaginator override current limit/offset Resolves: #94965 Releases: main
Related issues 1
History 613
-
Eric Chavaillaz commented <span data-processor="relativetime" data-value="2021-08-23T15:48:58+00:00" > 08/23/21, 15:48 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 72817 status
NewUnder Review <span data-processor="relativetime" data-value="2021-12-30T15:37:04+00:00" > 12/30/21, 15:37 </span> -
Gerrit Code Review pushed patch set 2 for main to change 72817 <span data-processor="relativetime" data-value="2022-01-24T13:27:38+00:00" > 01/24/22, 13:27 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 72817 <span data-processor="relativetime" data-value="2022-01-24T13:35:57+00:00" > 01/24/22, 13:35 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 72817 <span data-processor="relativetime" data-value="2022-01-25T11:43:16+00:00" > 01/25/22, 11:43 </span>
-
Daniel Haupt commented <span data-processor="relativetime" data-value="2022-01-26T17:57:12+00:00" > 01/26/22, 17:57 </span>
Related issue in ext:news: https://github.com/georgringer/news/issues/1681
-
Gerrit Code Review pushed patch set 5 for main to change 72817 <span data-processor="relativetime" data-value="2023-05-03T09:46:35+00:00" > 05/03/23, 09:46 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 72817 <span data-processor="relativetime" data-value="2023-07-08T12:03:53+00:00" > 07/08/23, 12:03 </span>
-
Stefan Bürk changed Related to #95802 <span data-processor="relativetime" data-value="2023-08-04T09:27:33+00:00" > 08/04/23, 09:27 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 72817 <span data-processor="relativetime" data-value="2024-10-18T14:10:55+00:00" > 10/18/24, 14:10 </span>
-
Benni Mack changed status
Under ReviewNew <span data-processor="relativetime" data-value="2024-12-17T20:29:32+00:00" > 12/17/24, 20:29 </span> -
S P commented and changed TYPO3 Version
1013 PHP Version7.4<span data-processor="relativetime" data-value="2026-07-08T08:47:38+00:00" > 07/08/26, 08:47 </span>I’d like to push this up. This bug is still a problem as of today (raised the version of this ticket to a still supported version) and super ugly. We use theext:news(which internally just uses standard extbase stuff) and want to unset the first few news records via an event (which teh news extension provides). Setting the offset just has simply no effect, because the pagination just ignores it later when doing its subrequests.Wait, this is a bug in the news extension, after all. It passes the wrong offset and limit to the Paginator… I’ll open a bug there.
For reference: https://github.com/georgringer/news/issues/2816
So, after all, I am not sure, whether this extbase bug is a bug at all. You actually can initialize a
QueryResultPaginatorwith offset and limit and is is respected. Of course the callers have to do so.
A possible workaround is to cast the “queryResult->toArray()” and then use “array_slice” like in the “ArrayPaginator”.