-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
whereHasMorph generates wrong sql in whereHas Callback #36536
Comments
Feel free to PR a fix. I probably won't spend any time myself digging into this. |
Also your query is a bit confusing - you have |
The E.g. I have one When I want to show all entries of a specific Version, in this case the latest, i need to find all PlanningContexts with a connection to another PlanningContext which is connected to the specific Version. I am also not sure if this is the best approach for my project. I am still researching. I have already tried to find the issue but with no success yet. But i will give it another try in my free time. |
We need to adjust
I see two options:
The first one would be more elegant, but I'm not sure if it works with all edge cases. |
Anyone up for PR'ing the above? |
The use of whereHasMorph in a whereHas callback generates a wrong sql statements. Correction of this incorrectly constructed statement has been applied.
Fixed with pull request #36801 can be closed. @driesvints |
@selcukcukur thanks! |
Description:
The use of whereHasMorph in a whereHas callback generates a wrong sql statements. A call to the whereHasMorph outside of a whereHas callback works fine.
The sql generated by the whereHas-whereHasMorph combination:
Steps To Reproduce:
The PlanningContext class
The code which reproduces the error:
The text was updated successfully, but these errors were encountered: