-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.1] Fix Issue #11169 #13360
[5.1] Fix Issue #11169 #13360
Conversation
@GrahamCampbell Getting failed StyleCI analysis on this, is this something you are aware of? |
e00f54e
to
de57cf5
Compare
Tests are failing too, I'll look into that when I get home... |
It looks like your fork is out of date and needs rebasing. |
@@ -860,7 +860,7 @@ public function morphTo($name = null, $type = null, $id = null) | |||
// If the type value is null it is probably safe to assume we're eager loading | |||
// the relationship. When that is the case we will pass in a dummy query as | |||
// there are multiple types in the morph and we can't use single queries. | |||
if (is_null($class = $this->$type)) { | |||
if (is_null($class = $this->$type) || $class === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to just change this to if (! empty($class = $this->$type)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that on a previous version which failed tests elsewhere in Model.php.
I will try again after I rebase back to 5.1
On 28 Apr 2016 18:31, "Graham Campbell" notifications@github.com wrote:
In src/Illuminate/Database/Eloquent/Model.php
#13360 (comment):@@ -860,7 +860,7 @@ public function morphTo($name = null, $type = null, $id = null)
// If the type value is null it is probably safe to assume we're eager loading
// the relationship. When that is the case we will pass in a dummy query as
// there are multiple types in the morph and we can't use single queries.
if (is_null($class = $this->$type)) {
if (is_null($class = $this->$type) || $class === '') {
Better to just change this to if (! empty($class = $this->$type)) {
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/laravel/framework/pull/13360/files/bc1519926bf4a5a541bfb1aafefe0bcba4f0acbe#r61468802
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this change isn't correct then, and our tests should be failing here too but the tests are just incomplete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats definitely a possibility, so an going to dig deeper and determine
what's going on and a fix.
On 28 Apr 2016 19:21, "Graham Campbell" notifications@github.com wrote:
In src/Illuminate/Database/Eloquent/Model.php
#13360 (comment):@@ -860,7 +860,7 @@ public function morphTo($name = null, $type = null, $id = null)
// If the type value is null it is probably safe to assume we're eager loading
// the relationship. When that is the case we will pass in a dummy query as
// there are multiple types in the morph and we can't use single queries.
if (is_null($class = $this->$type)) {
if (is_null($class = $this->$type) || $class === '') {
Maybe this change isn't correct then, and our tests should be failing here
too but the tests are just incomplete?—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/laravel/framework/pull/13360/files/bc1519926bf4a5a541bfb1aafefe0bcba4f0acbe#r61477087
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
3af995f
to
b5596ca
Compare
Seems I was being a little dense yesterday, looking over my previous commits I was checking Tests are now passing fine and this is the cleaner implementation. |
Assuming this is merged in to 5.1, I imagine it will need merging up to 5.2 and master as well as it doesn't appear to have been fixed there.