error message provides insufficient information for OneToMany with missing mappedBy #5920

Closed
opened 2026-01-22 15:22:07 +01:00 by admin · 1 comment
Owner

Originally created by @jakumi on GitHub (Mar 13, 2018).

The error message provides only half of the necessary information. It tells which attribute is concerned, but not on which entity, between which two entities, or anything else giving the required hint as to which mapping is wrong.

Adding the sourceEntity to the error message would provide that missing information and help locate the malformed mapping significantly. used in:
43c252458b/lib/Doctrine/ORM/Mapping/ClassMetadata.php (L730)

(since the called static function is public, I shy away from providing a pull request)

Originally created by @jakumi on GitHub (Mar 13, 2018). The error message provides only half of the necessary information. It tells which attribute is concerned, but not on which entity, between which two entities, or anything else giving the required hint as to which mapping is wrong. Adding the `sourceEntity` to the error message would provide that missing information and help locate the malformed mapping significantly. used in: https://github.com/doctrine/doctrine2/blob/43c252458b1c46081b828555013bb3fb0bb3c389/lib/Doctrine/ORM/Mapping/ClassMetadata.php#L730 (since the called static function is public, I shy away from providing a pull request)
admin added the Improvement label 2026-01-22 15:22:07 +01:00
admin closed this issue 2026-01-22 15:22:07 +01:00
Author
Owner

@Ocramius commented on GitHub (Mar 13, 2018):

@jakumi can be improved for 3.x. See https://github.com/doctrine/doctrine2/pull/6743

@Ocramius commented on GitHub (Mar 13, 2018): @jakumi can be improved for `3.x`. See https://github.com/doctrine/doctrine2/pull/6743
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5920