mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Misleading ORMInvalidArgumentException message #5254
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jonny-no1 on GitHub (Sep 13, 2016).
Originally assigned to: @lcobucci on GitHub.
Given two entities and a random class with similar name (to confuse the developer, but could be anything really):
If you add an instance of Group2 to User#$groups and try to persist, an exception will be thrown from Doctrine\ORM\UnitOfWork:832:
However, instead of reading like:
It reads like:
Simply because the
$expectedTypeisn't set correctly for many-to-many associations in Doctrine\ORM:201:@asiermarques commented on GitHub (Oct 22, 2017):
+1 this is a severe UX problem. That error message must be changed in order to avoid misunderstandings.
@lcobucci commented on GitHub (Oct 29, 2017):
@foaly-nr1 could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing.
You can find examples on
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket