I'm trying the new version and either not calling the method correctly or there is a bug in the uri nesting encoding.
I'm trying a simple node.load test
$('#doit').click(function() {
$('#servicetest').html("<h1>Calling node.load</h1>").fadeIn('slow');
nid = $('#nid').val();
target = $('#target').val();
Drupal.service('node.load',
{nid: nid, fields: ["nid", "title", "body"]},
asTest
);
});
which is getting posted as
1 title
2 body
fields[0] nid
method node.load
nid 1
So the method is called correctly but all that is returned is the node nid since that is all fields was encoded to request
{ "status": true, "data": { "nid": "1" } }
Am I calling it wrong or is this indeed a bug?
Thx.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | json_server_uri_encode_217400.patch | 2.39 KB | dldege |
Comments
Comment #1
dldege commentedA solution was found for this problem which was a bug in how the current nesting was handled while encoding the the array parameters. Two other bugs where also found and addressed
1) Optional arguments are not being handled correctly
2) uri encoded strings were not being decoded properly on the server.
Both of these issues came up while trying to use the taxonomy.selectNodes service if you wish to test a more complex service call.
Comment #2
jmiccolis commentedBumping the priority here as this seems to effect may different methods.
I've discovered the same issues with using the json server for node.save - the patch from comment #1 to json_server.js has worked for me.
Comment #3
skyredwang