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

[6.x] Fix edge case causing a BadMethodCallExceptions to be thrown when using loadMissing() #37871

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

MeesterDev
Copy link
Contributor

@MeesterDev MeesterDev commented Jun 30, 2021

Sometimes when relations are loaded, a collection of null and BaseCollections is returned. When this happens, the ->first() instanceof BaseCollection check can be false, as the first value can be null, in which case ->collapse() is incorrectly skipped.

There have been a few PRs more properly describing this issue, but these have been closed rather than merged:
#32043
#32053 (Comment by nal-chris on 18 Mar describes it pretty well)

I've chosen non-descriptive names for a few relations, feel free to suggest something more concrete (though these serve their purpose).

This is a replacement for #37864, which targeted 8.x.

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

2 participants