Closed (works as designed)
Project:
Services
Version:
6.x-3.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2011 at 03:02 UTC
Updated:
21 May 2012 at 06:30 UTC
There is a node reference field I cannot get to be posted correctly. It seems to be a bug related to the validation of node reference field, as there are 2 related issues (one of them in another module's queue) http://drupal.org/node/403140 and http://drupal.org/node/1309286
The JSON part to send this field data is:
"field_establishment":{"0":{"nid":{"nid":"26686"}}}
The first related issue http://drupal.org/node/403140 Error on autocomplete node reference field: found no valid post with that title. is for the module Node import, and it has working patch for it at comment #22
Comments
Comment #1
marcingy commentedThis is not a bug the data being posted should be exactly as expected by FAPI in this case it is obviously not and hence it is failing validation.
Comment #2
mac_weber commentedI posted a tutorial of how I solved it:
http://drupal.org/node/1354202 - Services 3 - POST node.create with custom fields
Comment #3
sarav.din33 commentedhi Mac_Weber,
I saw you post in http://drupal.org/node/1354202 and i follow it and posted as below,
But i received output as
{"nid": null, "uri": "http://localhost/end_point/node/" }I track some levels, in drupal_process_form() my reference field(field_review_reference) value won't get set.
Can you guide what is the problem in my case?
Thanks & Regards
Sarav.
Comment #4
mac_weber commented@Sarav,
maybe you are missing the part 3 of my tutorial, another cause may be not having that nid value in your database.
Comment #5
sarav.din33 commented@Mac_Weber,
I already saw part 3 of your tutorial. As per the tutorial only i gave my input as,
And also i gave the node id as "2349". This node id available in my site.
Can you please guide me, if the following scenario will affect my node creation. I wrote the following code in my hook_form_alter()
$form['field_review_reference'] - Node Reference field ID Name.
From above code i assigned the Default node reference Node ID.
I thought this scenario won't affect my node creation.
The same case in User Reference Field also. I assign some UID for that field, User won't set in Created Node.
Thanks & Regards
Sarav.