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

[Fix] morphTo relationship #2669

Merged
merged 13 commits into from Nov 8, 2023
Merged

Conversation

hans-thomas
Copy link
Contributor

Hi, it fixes #2657.

src/Relations/MorphTo.php Outdated Show resolved Hide resolved
@hans-thomas hans-thomas marked this pull request as ready for review November 6, 2023 14:31
@GromNaN GromNaN self-requested a review November 6, 2023 14:33
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changes should be done in HybridRelations.

There is a previous PR that that tries to fix morphTo #2640, but it does not solves the issue reported in #2657.

Also, in HybridRelations::morphTo, a "Check if it is a relation with an original model." with fallback to Eloquent is missing.

src/Relations/MorphTo.php Outdated Show resolved Hide resolved
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It fixes the issue reported in #2657.

@GromNaN GromNaN requested a review from alcaeus November 7, 2023 10:25
@alcaeus
Copy link
Member

alcaeus commented Nov 8, 2023

Thank you @hans-thomas!

@alcaeus alcaeus merged commit bfbe055 into mongodb:4.1 Nov 8, 2023
13 checks passed
@hans-thomas hans-thomas deleted the 2657-morphTo-relations branch November 23, 2023 13:12
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.

Support for morphTo relations broken in 4.1
3 participants