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

[8.x] The use of whereHasMorph in a whereHas callback generates a wrong sql statements #36801

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Conversation

selcukcukur
Copy link
Contributor

The use of whereHasMorph in a whereHas callback generates a wrong sql statements. The reason for this is that it cannot capture the "where" part correctly during parsing in the "hasMorph" method.

One thing to be aware of is that if this is a situation that occurs only in very complex queries, it may be possible to spoil something that is going well. Although the correction I applied allows it to do the same thing correctly, we cannot see if it will cause errors at the extreme points without trying.

I believe we should look at what endpoints create a problem or not by implementing this PR. It should not be forgotten that there is a possibility that it will not cause any problems.

The use of whereHasMorph in a whereHas callback generates a wrong sql statements. Correction of this incorrectly constructed statement has been applied.
@selcukcukur selcukcukur changed the title #36536 issue fix [8.x] The use of whereHasMorph in a whereHas callback generates a wrong sql statements Mar 29, 2021
@BrandonSurowiec
Copy link
Contributor

BrandonSurowiec commented Mar 29, 2021

Need to add a test to prove the fix. :)

@selcukcukur
Copy link
Contributor Author

Need to add a test to prove the fix. :)

It is not a pull request that basically changes the way it works. Already existing test files should have already indicated when there was a problem. Everything seems to be fine. But I will of course prepare and include it in the test files that I will take a look at at a convenient time if they need to be added.

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

Successfully merging this pull request may close these issues.

None yet

3 participants