Bug #1472
Bad interaction between _PreSave hook and check whether a record should be saved
Status:
Closed
Priority:
Normal
Assignee:
Elmer de Looff
Category:
Model
Target version:
-
Description
If one of the _PostCreate, _PostInit or _PostSave hooks add a key to the Record dictionary, and the record is saved subsequently, the _Changes method will indicate that the record has pending changes, even though the _PreSave hook might remove those before they actually hit the database.
For that reason, _PreSave should be executed before changes in the record are determined. If changes have been made, the record should be stored in the database, and the _PostSave hook should then always run.
Associated revisions
History
#1 Updated by Elmer de Looff over 12 years ago
- Status changed from New to Resolved
 - % Done changed from 0 to 70
 
Applied in changeset uweb|commit:b9f55930087f.
#2 Updated by Elmer de Looff over 12 years ago
- Status changed from Resolved to Closed
 - % Done changed from 70 to 100
 
This has been released as uWeb v0.2.9 and verified to work.
Fixed order in which Save() hooks are executed, preventing problems with changes that aren't actual database changes. This resolves #1472.