Opened 13 years ago

Closed 13 years ago

#1070 closed defect (fixed)

dojo.rpc.JsonService#parseResults checks value of result instead of presence of result [patch]

Reported by: niemand@… Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

The parseResults method in JsonService? does not return the proper value when an integer of value zero is returned by the remote procedure. Instead of the value zero, a object of the form {result: 0, id: 1} is returned.

The parseResults method uses the following to determine if a result is present in order to return just that result (over the entire object):

if(obj["Result"]||obj["result"]){
    return obj["result"]||obj["Result"];

If the remote procedure returns the integer value zero, the following fails and the full object is returned.

Attachments (1)

JsonService.js.patch (527 bytes) - added by niemand@… 13 years ago.
patch that checks presence instead of value of result field.

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by niemand@…

Attachment: JsonService.js.patch added

patch that checks presence instead of value of result field.

comment:1 Changed 13 years ago by guest

Version: 0.20.3

comment:2 Changed 13 years ago by niemand@…

Also, I am employed by IBM (wknorton@…). I am told IBM has a CCLA on file.

comment:3 Changed 13 years ago by dylan

Resolution: fixed
Status: newclosed

merged in [4662], thanks for the patch.

Note: See TracTickets for help on using tickets.