-
-
Notifications
You must be signed in to change notification settings - Fork 885
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
[Doctrine][Pagination] Complex OrderBy item must use output walker #1313
Comments
Needs a change in our QueryChecker? Feel free to continue on #1301 |
The bigger issue is that it might be unsafe in many cases to not use the output walkers, but we do not know. The only symptom may be incorrect paginated results. |
Hello, I’ve got the same issue with this DQL (Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers) : SELECT o FROM AppBundle\Entity\Event o
INNER JOIN o.dates dates_a1
WHERE o.superEvent IS NULL
ORDER BY dates_a1.doorTime DESC This is generated for this request: I’ve found that method |
9f9da0c last fix on the subject. Please help improving this! |
It returns false because on QueryChecker.php#L153 $metadata is the joined entity and on QueryChecker.php#L154 $relationship is 'o.joinedEntity'. There is never a field that has a dot in it, and even if there would be, it checks on the wrong metadata. I did a quick fix with the old code to see whether everything would work and it did. Basically did this:
This does not handle deeper associations, but I don't know whether that is needed. If @soyuka could look into this, that would be awesome. |
@rlantingmove4mobile fix works for me. |
…d to-many association
@ambroisemaupate would you mind sending a PR with your referenced commit? |
…d to-many association
…d to-many association
…d to-many association
The results are wrong for example when ordering by a result variable.
https://github.com/doctrine/doctrine2/blob/e6c434196c8ef058239aaa0724b4aadb0107940b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php#L141
The text was updated successfully, but these errors were encountered: