Issue Bug Closed

#97348Typo3DbQueryParser::convertQueryToDoctrineQueryBuilder ignores Limit and Offset

Christian Seyfferth 04/08/22, 19:58 updated 07/10/23, 16:41

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.

Reviews 1

History 38

  1. Gerrit Code Review pushed patch set 1 for main to change 74260 status New Under Review 04/08/22, 20:07

  2. Gerrit Code Review pushed patch set 2 for main to change 74260 04/08/22, 20:55

  3. Gerrit Code Review pushed patch set 3 for main to change 74260 04/09/22, 19:25

  4. Gerrit Code Review pushed patch set 4 for main to change 74260 04/11/22, 20:33

  5. Harald Holzmann commented 04/29/22, 10:57

    Can also confirm this.

      $concreteQb->setMaxResults($limit);
      $concreteQb->setFirstResult($offset);

    is missing

  6. Gerrit Code Review pushed patch set 5 for main to change 74260 05/03/23, 09:45

  7. Benni Mack changed status Under Review New 07/07/23, 14:32

  8. Stefan Froemken commented and changed status New Closed 07/10/23, 16:41

    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