Return value of Doctrine\ORM\Query::getFirstResult() must be of the type int or null, string returned #6848

Closed
opened 2026-01-22 15:39:59 +01:00 by admin · 3 comments
Owner

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

Bug Report

Calling getFirstResult() results in an error:
Return value of Doctrine\ORM\Query::getFirstResult() must be of the type int or null, string returned

Q A
BC Break no
Version 2.10.0

Summary

After updating from 2.9.6 to 2.10.0 I'm getting this error, reverting back to 2.9.6 resolves this.

Current behavior

The above error is shown.

How to reproduce

Can't really build a stub to reproduce, the error is a result of a query by sg/datatablesbundle, it calls getIterator() in the Paginator which calls getFirstResult().

Expected behavior

Not seeing an error as with version 2.9.6, maybe related to #9086?

Originally created by @knallcharge on GitHub (Oct 5, 2021). ### Bug Report Calling getFirstResult() results in an error: Return value of Doctrine\ORM\Query::getFirstResult() must be of the type int or null, string returned | Q | A |------------ | ------ | BC Break | no | Version | 2.10.0 #### Summary After updating from 2.9.6 to 2.10.0 I'm getting this error, reverting back to 2.9.6 resolves this. #### Current behavior The above error is shown. #### How to reproduce Can't really build a stub to reproduce, the error is a result of a query by sg/datatablesbundle, it calls getIterator() in the Paginator which calls getFirstResult(). #### Expected behavior Not seeing an error as with version 2.9.6, maybe related to #9086?
admin added the Bug label 2026-01-22 15:39:59 +01:00
admin closed this issue 2026-01-22 15:40:00 +01:00
Author
Owner

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

Yes, the issues seems related and I would expect that a similar fix would help. Up for a PR?

@derrabus commented on GitHub (Oct 5, 2021): Yes, the issues seems related and I would expect that a similar fix would help. Up for a PR?
Author
Owner

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

see #9090

@knallcharge commented on GitHub (Oct 5, 2021): see #9090
Author
Owner

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

Awesome, thanks!

@derrabus commented on GitHub (Oct 5, 2021): Awesome, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6848