Issue Bug New Stale

#94965QueryResultPaginator override current limit/offset

Eric Chavaillaz 08/23/21, 15:36 updated 07/08/26, 08:48

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

History 613

  1. Eric Chavaillaz commented <span data-processor="relativetime" data-value="2021-08-23T15:48:58+00:00" > 08/23/21, 15:48 </span>

    A possible workaround is to cast the “queryResult->toArray()” and then use “array_slice” like in the “ArrayPaginator”.

  2. S P commented and changed TYPO3 Version 10 13 PHP Version 7.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 the ext: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 QueryResultPaginator with offset and limit and is is respected. Of course the callers have to do so.