Skip to content

Fix HasOneSql their field update hook#1037

Merged
mvorisek merged 2 commits intodevelopfrom
fix_hasone_their_table_update_hook
Jul 23, 2022
Merged

Fix HasOneSql their field update hook#1037
mvorisek merged 2 commits intodevelopfrom
fix_hasone_their_table_update_hook

Conversation

@mvorisek
Copy link
Copy Markdown
Member

The hook was updating our model using SQL query, which was dangerous as all validation/normalization/hooks were skipped. I checked the rest of the atk4/data code, and thankfully, all similar dangerous updates were already migrated to materiazed update.

One of dangerous behaviour was described in atk4/filestore#26.

The hook conditions are still not right and I will fix them in another PR. Thus this PR does not fix the filestore issue, but prevents any related data corruption to happen - if mismatched data are given, an exception is thrown.

@mvorisek mvorisek merged commit 231547f into develop Jul 23, 2022
@mvorisek mvorisek deleted the fix_hasone_their_table_update_hook branch July 23, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant