Skip to content
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

Make error message suggestion accurate #9537

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

kiler129
Copy link
Contributor

@kiler129 kiler129 commented 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.

Fixes #9536

@greg0ire greg0ire changed the title Fix bug-#9536 Make error message accurate Feb 22, 2022
@greg0ire greg0ire changed the title Make error message accurate Make error message suggestion accurate Feb 22, 2022
@greg0ire greg0ire added the Bug label Feb 22, 2022
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write a unit test for this in tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php

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.
@greg0ire greg0ire added this to the 2.11.2 milestone Feb 22, 2022
@greg0ire greg0ire merged commit 856c314 into doctrine:2.11.x Feb 22, 2022
@greg0ire
Copy link
Member

Thanks @kiler129 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error message for bi-dir O:O with no mappedBy
3 participants