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] Backport for fix issue with polymorphic morphMaps with literal 0 (#35364) #35487

merged 3 commits into from Dec 4, 2020


Copy link

This is a backport of #35364 to Laravel 6 LTS.

* fix: use strict null check on morphTo type

* test: assert 0 relation_type is handled correctly
Copy link

@dmytro-laba dmytro-laba left a comment

Choose a reason for hiding this comment

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

IMO, this will break the backwards compatibility for cases where $this->{$type} is empty string. At least in my project it throws an exception.
I'd suggest adding an explicit check for zero there (in addition to empty) or checking the length of $this->{$type}.

@taylorotwell taylorotwell merged commit 57797fa into 6.x Dec 4, 2020
2 checks passed
@taylorotwell taylorotwell deleted the backport-issue branch December 4, 2020 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

5 participants