Closed (duplicate)
Project:
Services
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2010 at 20:03 UTC
Updated:
27 Jan 2011 at 03:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
kylebrowning commentedTesting
Comment #2
IncrediblyKenzi commentedSetting to needs review so the test bot will pick it up.
Comment #4
IncrediblyKenzi commentedTrying the patch again from the root of the project.
Comment #6
voxpelli commentedIsn't this kind of a duplicate of either #952344: Check if argument is struct or array and parse differently or #954964: Remove argument type 'struct' in favor of 'array'? Probably a combination of both?
Comment #7
IncrediblyKenzi commentedIn a sense, yes, but I can't see a way of handling this ubiquitously.. It's more-or-less a problem upstream; drupal sometimes requires an object (e.g. node) and other times requires an array.
Comment #8
IncrediblyKenzi commented#4: user_save_array_2.patch queued for re-testing.
Comment #10
qawsed commentedHi, I'm trying to use user.save to change the user location from a mobile application and would really like to see user.save working.
When I test the user.save with JSON in the account parameter, (ex: {"uid":"3","name":"jon","mail":"jon@mail.com","mode":"0","location":{"lid":"5","name":"Jon's Place"}}, I have get the following:
warning: array_keys(): The first argument should be an array in /hsphere/local/home/c149246/orderhub.ca/modules/block/block.module on line 385.
warning: array_fill(): Number of elements must be positive in /hsphere/local/home/c149246/orderhub.ca/includes/database.inc on line 253.
warning: implode(): Invalid arguments passed in /hsphere/local/home/c149246/orderhub.ca/includes/database.inc on line 253.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR r.rid IS NULL) ORDER BY b.weight, b.module' at line 1 query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN () OR r.rid IS NULL) ORDER BY b.weight, b.module in /hsphere/local/home/c149246/orderhub.ca/modules/block/block.module on line 386.
Location field is required.
It looks Drupal wants to use arrays on the upstream (why can't they just stick to objects…)
However, if I give it as an JSON array, then I get the following:
Username field is required.
E-mail address field is required.
Password field is required.
Because all elements of the array are treated the same and we can't distinguish element is username, email etc.
Would it help if we converted the JSON array into stdclass in user_services.inc?
Comment #11
kylebrowning commentedduplicate #952344: Check if argument is struct or array and parse differently