Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#10615 closed defect (fixed)

JsonRest.js: Put objects in dirty state if a save fails

Reported by: holger Owned by: Kris Zyp
Priority: high Milestone: 1.8
Component: Dojox Version: 1.4.0
Keywords: JsonRest dirty Cc: holger.salewski@…
Blocked By: Blocking:

Description

Changeset 20693 for dojox/trunk/rpc/JsonRest.js: [line 121]

dirtyObjects = dirtyObject.concat(savingObjects);

That doesn't works well for me. dirtyObject is not referenced somewhere else. I tried to change it to dirtyObjects.concat but in this case dirtyObjects tends to grow if more then one object has been rejected by the server and moreover the dirty-flag hasn't been set, again. So, I found a solution with:

   dojo.forEach(savingObjects, function(obj) {
	jr.changing(obj.object);
    });

Change History (5)

comment:1 Changed 10 years ago by Adam Peller

Owner: changed from Adam Peller to Kris Zyp

comment:2 Changed 8 years ago by bill

Partly addressed in #13037, but there's still a reference to dirtyObject.

comment:3 Changed 8 years ago by reubenh

This is still an issue in 1.7.1.

As an example, when performing a JsonRestStore?.save({revertOnError: false}), a ReferenceError? is triggered, due to the reference to dirtyObject, which is not defined.

Changing the reference to diryObjects does not work either, but the solution mentioned in the original post does.

Presence of this bug makes CDN usage a no go for people wishing to use the revertOneError: false option, since JsonRest?.js needs to be manually patched.

comment:4 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

In [27483]:

Properly add dirty objects back on failure-induced revert, fixes #10615 !strict

comment:5 Changed 8 years ago by bill

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.