Skip to content

Entity null values cause database error #1992

Description

@MGatner

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 insert null entity values into the database, which will throw an exception for columns that cannot be null.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions