# HG changeset patch # User Pierre-Yves David # Date 1331133404 -3600 # Node ID 87c72dccf7b9ec0c5e596bbc03bf1d63545b7553 # Parent f23782a2cdeea3b1a36da51c8b1b6978199c0e0f [storage/bfss] ensure bfss never remove a cw_edited item (closes #2236287) When the == (not really and update but can happen), the value was popped but never restored. The cw_edited attribut had wrong content for a small time lapse. diff -r f23782a2cdee -r 87c72dccf7b9 server/sources/storages.py --- a/server/sources/storages.py Wed Mar 07 16:09:55 2012 +0100 +++ b/server/sources/storages.py Wed Mar 07 16:16:44 2012 +0100 @@ -175,16 +175,16 @@ # Mark the new file as added during the transaction. # The file will be removed on rollback AddFileOp.get_instance(entity._cw).add_data(fpath) - if oldpath != fpath: - # register the new location for the file. + # reinstall poped value if fpath is None: entity.cw_edited.edited_attribute(attr, None) else: + # register the new location for the file. entity.cw_edited.edited_attribute(attr, Binary(fpath)) + if oldpath is not None and oldpath != fpath: # Mark the old file as useless so the file will be removed at # commit. - if oldpath is not None: - DeleteFileOp.get_instance(entity._cw).add_data(oldpath) + DeleteFileOp.get_instance(entity._cw).add_data(oldpath) return binary def entity_deleted(self, entity, attr):