-
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
Null compatibility broken #43705
Comments
@tpetry since you originally created #37961 which sparked #41337: do you know of a way to do a fix so both issues are resolved? Also want to ping you @JBtje since you're the author of #41337. @jc-skurman this change has been in the framework now for several months. Did you only update Laravel now recently? |
I just now caught this bug on the old version and after indicating that you no longer support it, I checked it on the latest version |
I've checked issues can be reproduced if you have } elseif ($this->hasCast($key, ['object', 'collection'])) {
return $this->fromJson($attribute) ===
$this->fromJson($original); change to } elseif ($this->hasCast($key, ['object', 'collection'])) {
return $this->castAttribute($key, $attribute) ===
$this->castAttribute($key, $original); |
I replaced the dirty check with my custom implementation because in my projects I found a lot more edge cases, e.g. different order of object keys. But based on the implementation of the PR the null value has to be handled too. |
First and foremost, But if you think
solves the warning. |
@JBtje that's not true actually. |
Would appreciate a PR to fix this. |
Edit: PHP was right... @driesvints After reading up some more on the topic; the json-text must be a string.
Javascript however accepts null (object), true/false (bool) as input. This is allowed under RFC8259 but not mandatory. Cause of this problem: Solution to support |
We merged a fix for this. Thanks |
MySql 8
Description:
When we use a cast of type 'object', 'collection' and we have the original value null, we get an error when trying to decode json.
This change appeared in the PR and is still relevant even for version 9.
PR
We get the warning
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: