Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8418 closed defect (fixed)

dojox.rpc.jsonrest does not pass return arguments in commit()'s error handler

Reported by: John Locke Owned by: anonymous
Priority: high Milestone: 1.3
Component: General Version: 1.2.3
Keywords: jsonreststore, jsonrest Cc:
Blocked By: Blocking:

Description

Discovered when trying to trap an error being passed from the server to a dojox.data.JsonRestStore?, in response to a PUT.

When you call the JsonRestStore?.save() method and pass an onError function, that function does not receive any arguments.

Expected result: Should receive the error response from XHR.

Suggested patch:

--- a/dojox/rpc/JsonRest.js
+++ b/dojox/rpc/JsonRest.js
@@ -122,7 +122,7 @@ dojo.require("dojox.rpc.Rest");
                                        jr.revert(); // revert if there was an e
                                        dirtyObjects = postCommitDirtyObjects;
                                        if(kwArgs.onError){
-                                               kwArgs.onError();
+                                               kwArgs.onError(arguments);
                                        }
                                        return value;
                                });

Change History (3)

comment:1 Changed 11 years ago by John Locke

After testing the patch, kryszyp's version is better.

kwArgs.onError(arguments) passes an array with the first element set to the response object.

kwArgs.onError(value) works as expected, passing just the response object.

comment:2 Changed 11 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

comment:3 Changed 11 years ago by Adam Peller

Milestone: tbd1.3

batch move of tickets marked 'tbd' fixed in the 1.3 timeframe

Note: See TracTickets for help on using tickets.