-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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.5] add date and cast check for dirty #18400
Conversation
Your tests fail. |
Hm... |
|
||
// When check rich this check and current attribute value not equals with original, we should skip next steps | ||
// if current is null | ||
if (is_null($current)) { |
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.
This check for nullable may be should move to fromDateTime method as like castAttribute method.
This hack check looked from setAttribute
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.
Fully agree, either that or should to include the original value in the check too:
if (is_null($current) || is_null($original)) {
is_null($current)
covers updating filled column with NULLis_null($original)
covers updating NULL with filling
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.
The missing is_null($original)
causes problems for deleted_at
which is NULL before a model is updated.
Reopened PR from #18385
add tests