Hello. Our team is developing a web site.
During the implementation, we are facing on problem related to creating a node with node reference field.

The below is a part of json results when we request a node information using a REST service module.

"field_places":{"und":[{"nid":"8"},{"nid":"9"}]}

However, when we create a new node using a json query, the notation is not working.
For example, if "field_places":{"und":[{"nid":"12"},{"nid":"14"}]} uses again

-----------------------------------------
form_errors:
field_places][und][0][nid: 'Place Nodes: found no valid post with that title.'
field_places][und][1][nid: 'Place Nodes: found no valid post with that title.'
-----------------------------------------

are returned.

Anybody who know how to make a json query for creating a node with node reference field

Comments

gsgphg’s picture

Title: Createing a node with node reference field » Creating a node with node reference field in REST Service
mac_weber’s picture

Try changing the nid value to "[nid:xxxx]"
It may be related to http://drupal.org/node/1353662

I posted a tutorial of how I solved it:
http://drupal.org/node/1354202 - Services 3 - POST node.create with custom fields

gsgphg’s picture

Thank you a lot !!!
I would be a good reference :)

yched’s picture

Status: Active » Fixed

I guess the question has been answered. Thks @Mac_Weber

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

modified unclear body