Project

General

Profile

Bug #1472

Bad interaction between _PreSave hook and check whether a record should be saved

Added by Elmer de Looff about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Elmer de Looff
Category:
Model
Target version:
-
Start date:
2013-05-09
Due date:
% Done:

100%

Estimated time:
Spent time:

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

Revision 336:b9f55930087f (diff)
Added by Elmer de Looff about 6 years ago

Fixed order in which Save() hooks are executed, preventing problems with changes that aren't actual database changes. This resolves #1472.

History

#1 Updated by Elmer de Looff about 6 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 about 6 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.

Also available in: Atom PDF