-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Validator throwing a doctrine mapping exception when using an indexBy
on a sub property
#46804
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
Comments
indexBy
on a sub property
Hey, thanks for your report! |
yes, I had to work around it by changing the index to use to |
Hey, thanks for your report! |
haven't tried it, but if nobody fixed it, it should still be relevant |
Hey, thanks for your report! |
Friendly reminder that this issue exists. If I don't hear anything I'll close this. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Symfony version(s) affected
5.4.10
Description
This issue is related to #39667 and #37982
If
indexBy
is referring to a subproperty of the relation, aDoctrine\ORM\Mapping\MappingException
is thrown when the validator tries to resolve the metadata. Symfony/Doctrine itself are working fine doing this and correctly indexing the relations, but as soon as the validator tries to resolve the metadata, the below exception is thrown. I came across this issue after I installed theapi_platform
bundle which instantly threw the exception in my face.Exception:
How to reproduce
Example class structure:
In my case the exception has been triggered by api-platform, but I suppose any attempt to validate the article entity would cause this exception
Possible Solution
No response
Additional Context
Trace:
The text was updated successfully, but these errors were encountered: