Project

General

Profile

Actions

Bug #104497

open

[Bug] in QueryBuilder::setMaxResults()

Added by Harald Witt 3 months ago. Updated 3 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2024-07-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Core queryBuilder setMaxResults
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Garvin Hicking 3 months ago

  • Category set to Database API (Doctrine DBAL)
  • Status changed from New to Needs Feedback
  • Assignee set to Stefan Bürk

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.

Actions

Also available in: Atom PDF