Object could not be converted to string after upgrade to 2.6.0 #5867

Closed
opened 2026-01-22 15:20:34 +01:00 by admin · 5 comments
Owner

Originally created by @pepakriz on GitHub (Jan 31, 2018).

Originally assigned to: @lcobucci on GitHub.

Hi,

After upgrade to 2.6.0 I got Object could not be converted to string after upgrade to 2.6.0.

Mybe because this PR: https://github.com/doctrine/doctrine2/pull/6141 . Now custom types must implement __toString method when they are used as discriminators. Is this behaviour correct?

Originally created by @pepakriz on GitHub (Jan 31, 2018). Originally assigned to: @lcobucci on GitHub. Hi, After upgrade to 2.6.0 I got `Object could not be converted to string after upgrade to 2.6.0`. Mybe because this PR: https://github.com/doctrine/doctrine2/pull/6141 . Now custom types must implement `__toString` method when they are used as discriminators. Is this behaviour correct?
admin added the BugMissing TestsRegression labels 2026-01-22 15:20:34 +01:00
admin closed this issue 2026-01-22 15:20:35 +01:00
Author
Owner

@Ocramius commented on GitHub (Jan 31, 2018):

@pepakriz discriminators didn't support object values before 2.6

@Ocramius commented on GitHub (Jan 31, 2018): @pepakriz discriminators didn't support `object` values before `2.6`
Author
Owner

@pepakriz commented on GitHub (Feb 1, 2018):

Maybe not officially, but it works on my code (version 2.5.14) without __toString :)

@pepakriz commented on GitHub (Feb 1, 2018): Maybe not officially, but it works on my code (version 2.5.14) without __toString :)
Author
Owner

@Ocramius commented on GitHub (Feb 1, 2018):

In a reproducible way? Can you compare your code to the one in #6141 and see if there are any major differences?

@Ocramius commented on GitHub (Feb 1, 2018): In a reproducible way? Can you compare your code to the one in #6141 and see if there are any major differences?
Author
Owner

@stollr commented on GitHub (Oct 25, 2018):

@Ocramius I think this issue can be closed, because there has not been any feedback.

@stollr commented on GitHub (Oct 25, 2018): @Ocramius I think this issue can be closed, because there has not been any feedback.
Author
Owner

@lcobucci commented on GitHub (Sep 20, 2019):

Closing here due to inactivity, we can reopen once we have a way to reproduce it.

@lcobucci commented on GitHub (Sep 20, 2019): Closing here due to inactivity, we can reopen once we have a way to reproduce it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5867