Bug #52591

The Pagination Widget broken for joined objects

Added by Philipp Maier about 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-10-07
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

In cases where objects are reconstructed through joins, setting the LIMIT leads to an incomplete result set.

Doctrine provides an Paginator for these purposes. The widget should use this paginator as soon as it is available in Flow (see: http://forge.typo3.org/issues/52590).

#1

Updated by Philipp Maier about 7 years ago

In the meantime you can fetch the QueryBuilder from the query object with the ObjectAccess methods (suggested by julle).
Then use the queryBuilder for the Paginator.

$queryBuilder = ObjectAccess::getProperty($query, 'queryBuilder', TRUE);
$paginator = new \Doctrine\ORM\Tools\Pagination\Paginator($modifiedObjects);
$modifiedObjects = $paginator->getIterator();

Also available in: Atom PDF