-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading error message for bi-dir O:O with no mappedBy #9536
Comments
kiler129
added a commit
to kiler129/orm
that referenced
this issue
Feb 22, 2022
Wrong validation message is displayed when an incorrect bidirectional one-to-one mapping is set up. When the owning side is configured correctly and the target side is missing the back reference the ORM suggests adding inverseBy instead of mappedBy, with the field name missing.
kiler129
added a commit
to kiler129/orm
that referenced
this issue
Feb 22, 2022
Wrong validation message is displayed when an incorrect bidirectional bi-directional mapping is set up. When the owning side is configured correctly and the target side is missing the back reference, the ORM suggests adding inverseBy instead of mappedBy, with the field name missing. This commit fixes this problem.
kiler129
added a commit
to kiler129/orm
that referenced
this issue
Feb 22, 2022
Wrong validation message is displayed when an incorrect bidirectional bi-directional mapping is set up. When the owning side is configured correctly and the target side is missing the back reference, the ORM suggests adding inverseBy instead of mappedBy, with the field name missing. This commit fixes this problem.
derrabus
added a commit
to derrabus/orm
that referenced
this issue
Feb 25, 2022
* 2.12.x: Document QueryComponent array shape (doctrine#9527) Improve templating Un-deprecate the current proxy mechanism (doctrine#9532) Remove unused methods Fix bug-doctrine#9536
derrabus
added a commit
to derrabus/orm
that referenced
this issue
Feb 25, 2022
* 2.12.x: Document QueryComponent array shape (doctrine#9527) Improve templating Un-deprecate the current proxy mechanism (doctrine#9532) Remove unused methods Fix bug-doctrine#9536
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
Wrong validation message is displayed when an incorrect bidirectional one-to-one mapping is set up. When the owning side is configured correctly and the target side is missing the back reference the ORM suggests adding
inverseBy
instead ofmappedBy
.I may be wrong, but adding such
inversedBy
creates another error in the mapping, while usingmappedBy
results in mapping passing the validation.Current behavior
How to reproduce
bin/console doctrine:schema:validate
Expected behavior
I believe that the message should suggest adding
mappedBy
and notinversedBy
, as according to the docs, the owning side needsinversedBy
while the target side usesmappedBy
. In addition it seems like the target entity reference should contain a field which is missing (nothing after#
).With both fixed the message will look like the following:
See PR #9537
The text was updated successfully, but these errors were encountered: