Fix joinRelations with multiple associations. #2791
Merged
+168
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I propose my first contribution to the project.
I found that the final SQL query was not correct in the case where an entity had several doctrinal relationships and was asked to retrieve some properties with the PropertyFilter.
Example:
uri:
/api/examples?properties[relation1][]=property1&properties[relation2][]=property2
In this case the relation1 has been added but relation2 is ignored.
After searching, you can see that the bug is coming from:
src/Bridge/Doctrine/Orm/Extension/EagerLoadingExtension.php
line 169 or the context is overwritten.I propose my modification to fix the bug.
Sorry I'm not good at unit testing so if someone can help me write it I'm interested.