-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Entity null values cause database error #1992
Comments
You're right that |
We're hitting some complex issues here that I think are going to require a refactor of Entities. On the plus side, I think it'll make them more robust. My plan is to make them work a little more like Laravel's Models insofar as you don't have to specify properties anymore. We'll keep two protected properties - Unfortunately, that means that anyone who's built anything already will have to refactor, but that's the fun of pre-release software I guess. |
I love it! Always worth it to stop and redo something the right way. Let me know how I can help. |
PR#1989 ?
…On Fri, May 10, 2019, 12:03 MGatner ***@***.***> wrote:
I love it! Always worth it to stop and redo something the right way.
Let me know how I can help.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1992 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACAGMUQHUCZEXREKTFDFAR3PUVCAVANCNFSM4HLKWUFA>
.
|
@MGatner I got through about 80% of the required changes last night, I believe. So shouldn't take too long to get switched over. Thanks, though! @nowackipawel Unrelated to Entities. |
Issue #1773 needed null values to be included in model verification, but by using all values from
classToArray
(instead of $onlyChanged)Model->save()
now attempts to insertnull
entity values into the database, which will throw an exception for columns that cannot benull
.I think
save()
should still use only changed values and validation should be updated to check for non-existent required values. Also, I believe #1930 passed tests because tests/system/Database/Live/ModelTest.php (e.g.testSaveNewEntityWithDate()
) is defining all field values, which is non-mandatory.The text was updated successfully, but these errors were encountered: