Project

General

Profile

Actions

Feature #102194

closed

Paginator for QueryBuilder

Added by Philipp Kitzberger over 1 year ago. Updated about 1 month ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2023-10-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Currently there's two Paginators in the core:

  • \TYPO3\CMS\Core\Pagination\ArrayPaginator
  • \TYPO3\CMS\Extbase\Pagination\QueryResultPaginator

Neither of them is ideal for QueryBuilder results, right?

Sure we could use ArrayPaginator like this:

$query = $queryBuilder->select('*')->from('tt_content');
new ArrayPaginator($query->executeQuery()->fetchAll(), $currentPage, $itemsPerPage);

But this will always fire the whole SELECT statement without any LIMIT to the database.

I suggest to add a 3rd paginator to the core: QueryResultPaginator

Actions #1

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New 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/+/81447

Actions #2

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/+/81447

Actions #3

Updated by Bastian Stargazer about 1 year ago

Will this feature patch also be available in v11? That would be awesome!

Actions #4

Updated by Stefan Bürk about 1 month ago

  • Status changed from Under Review to Rejected

Rejectiong this request as "Won't do" as this is currently not doable in a working way,
at least as a generic overall solution which TYPO3 should strive for.

See comments in the provided change, but the current solution
lacks support for two major things:

  • Full record language overlay handling
  • Full workspace support (moved,deleted,added in workspace, resorted, ...)

That means the plain QueryBuilder paginator could only be used in single language (default)
instance without workspaces and is not reliable in instances using one or both and leading
to a fallout of upcoming multipe issues targeting the missing support and asking why it
does not automatically resolve these things.

I don't see any easy way to implement this in a satisfing way even with a lot of time investment
plus the time required to deal with the following issue reports.

I'd suggest to provide this paginator implementation as a dedicated extension mentioning the restriction.

Actions

Also available in: Atom PDF