Issue Bug Closed

#104497[Bug] in QueryBuilder::setMaxResults()

Harald Witt 07/29/24, 12:38 updated 08/16/26, 12:22

Description

It is documented for 12.4 that using ->setMaxResults(null) in QueryBuilder will return all results.
See: https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Database/QueryBuilder/Index.html#setmaxresults-and-setfirstresult

But doing so results in this error message:
@Uncaught TYPO3 Exception TYPO3\CMS\Core\Database\Query\QueryBuilder::setMaxResults(): Argument #1 ($maxResults) must be of type int, null given, called in …@

Is this a core bug or a documentation bug?

In main it seems to be implemented because the method signature is public function setMaxResults(?int $maxResults = null): QueryBuilder.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Garvin Hicking commented and changed category status New Needs Feedback assigned to Stefan Bürk <span data-processor="relativetime" data-value="2024-07-29T19:13:40+00:00" > 07/29/24, 19:13 </span>

    Hi Stefan,

    Putting this on your tab to ponder about whether what was talked about in slack is useful – adding a layer on top of this to allow 0/null both, to foster a v13 deprecation instead of a hard BC in v13.
    Feel free to unassign, or let me know how you want this to move forward.

  2. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-08-16T12:22:44+00:00" > 08/16/26, 12:22 </span>

    as this change is about v12 which is now EOL and it works with 13+ I am closing this issue as cleanup