Hello,
As the title suggests, I need to create a new node, using xmlrpc from Java.
The problem is this node has a user reference field that I need to fill.
I tried all of the following:
* [{uid => 1}]
* [{value => 1}]
* [{uid => 1}, {value => username}]
none of them worked... I get "found no valid user with that name".
Please Help!
Comments
Comment #1
ofridagan commentedDoes someone know how to use node.save to create a new node with a user-reference field?
Thanks.
Comment #2
marcingy commentedso you raised this issue yesterday and then create noise today....this is not how to get help
Comment #3
ofridagan commentedsorry about the "noise"... didn't mean to cause any problems... it just a little urgent for me.
again, sorry.
Comment #4
ofridagan commentedI will really appreciated any kind of help.
Thanks.
Comment #5
rolf vreijdenberger commentedI'd suggest looking (finding) for the error message in the services module and then put some debug stuff in there, maybe the value of the 'name' that the error message suggest, to get some more info on what you are sending (or missing)
I have no experience on that specific matter.
Comment #6
ofridagan commentedThanks!
The only message I get is: "found no valid user with that name".
I want to the line of code which produces this error:
I tried to add to the error message the $value... strangely I only get the first letter of the username!
I even tried getting an existing node, and creating a new node, passing the exact value I received, for this field, and I still get the same error.
I'm having a hard time figuring out what this even has to do with "auto complete"... maybe I'm wrong.
If there is any other information that will help, please tell me.
Thanks!
Comment #7
ofridagan commentedOK, finally!
I changed the widget of the user reference field from auto-complete to select-list and that solved everything.
That's weird.. could not really find the reason.
Comment #8
rolf vreijdenberger commentedok, thanks for posting an update.
did you use an http sniffer to see if you're sending different post/get data?
it might be in the structure of the data you're sending, it can still be a bug.
Comment #9
marcingy commentedThe key is having the correct data structure and the structure is a fapi structure not a node structure.
Comment #10
newnewuser commentedI tried as ofridagan suggested in #7 (change to select list) unsuccessfully. Any other hints?
I ran into the same problem for node reference field. But for node reference field, I used "Autocomplete text field with create" (module noderefcreate) to solve the problem. I don't know how to circumvent problem for user reference field. Any help is highly appreciated.
Note: I use JSON not XMLRPC. Should it be part of a problem?