Bug #97348
closedTypo3DbQueryParser::convertQueryToDoctrineQueryBuilder ignores Limit and Offset
0%
Description
When converting a QueryInterface to DoctrineQueryBuilder like this:
$query = $this->createQuery();
...
$query->setLimit(10);
$query->setOffset(20);
$queryParser = GeneralUtility::makeInstance(Typo3DbQueryParser::class);
$queryBuilder = $queryParser->convertQueryToDoctrineQueryBuilder($query);
The Limit and Offset are ignored while converting.
This affects all versions of Typo3, as far as I know.
Updated by Gerrit Code Review over 2 years 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/+/74260
Updated by Gerrit Code Review over 2 years 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/+/74260
Updated by Gerrit Code Review over 2 years 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/+/74260
Updated by Gerrit Code Review over 2 years 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/+/74260
Updated by Harald Holzmann over 2 years ago
Can also confirm this.
$concreteQb->setMaxResults($limit);
$concreteQb->setFirstResult($offset);
is missing
Updated by Gerrit Code Review over 1 year ago
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/+/74260
Updated by Stefan Froemken over 1 year ago
- Status changed from New to Closed
Hello Christian,
thank you for providing this issue. I love this idea in general, but this class is marked for internal use only. The extbase system uses this method from two different locations: collecting the data (method: getObjectDataByQuery) and counting the data (method: getObjectCountByQuery). Please have a look at both of the methods. The setting part of limit and offset differs a lot. That's why we can't integrate this part into convertQueryToDoctrineQueryBuilder directly. Please adapt that part on your own.
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan