Type error in getMaxResults, string returned instead of ?int #6850

Closed
opened 2026-01-22 15:40:02 +01:00 by admin · 2 comments
Owner

Originally created by @YetiCGN on GitHub (Oct 5, 2021).

Bug Report

Q A
Version 2.10.0

Summary

After updating from 2.9.6 to 2.10.0 we are getting type errors from Doctrine\ORM\Query,

Current behavior

Execute certain queries and getMaxResults() fails with:

Uncaught Error: Doctrine\ORM\Query::getMaxResults(): Return value must be of type ?int, string returned 
at /var/www/releases/20211005133026/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:693)"} 

Downgrading to 2.9.6 gets rid of this problem. I don't know if all queries are affected or only some. Somewhere the maxResults class property is set to a string when it should always be a (nullable) integer.

How to reproduce

Install version 2.10.0 and run app or tests with a database query that retrieves maxResults.

Originally created by @YetiCGN on GitHub (Oct 5, 2021). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | Version | 2.10.0 #### Summary After updating from 2.9.6 to 2.10.0 we are getting type errors from Doctrine\ORM\Query, #### Current behavior Execute certain queries and `getMaxResults()` fails with: ``` Uncaught Error: Doctrine\ORM\Query::getMaxResults(): Return value must be of type ?int, string returned at /var/www/releases/20211005133026/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:693)"} ``` Downgrading to 2.9.6 gets rid of this problem. I don't know if all queries are affected or only some. Somewhere the `maxResults` class property is set to a string when it should always be a (nullable) integer. #### How to reproduce Install version 2.10.0 and run app or tests with a database query that retrieves maxResults.
admin closed this issue 2026-01-22 15:40:02 +01:00
Author
Owner

@derrabus commented on GitHub (Oct 5, 2021):

Duplicate of #9086

@derrabus commented on GitHub (Oct 5, 2021): Duplicate of #9086
Author
Owner

@YetiCGN commented on GitHub (Oct 5, 2021):

Only searched through open tickets, that's why I didn't find the existing ticket. Sorry!

@YetiCGN commented on GitHub (Oct 5, 2021): Only searched through open tickets, that's why I didn't find the existing ticket. Sorry!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6850