I'm using RESTws and POSTing a JSON object to "/node". Everything works fine until I include a List text field (checkbox type). The field in question is:
...
"field_days_closed_v": ["Monday", "Tuesday"],
...
When I post I get this error:
Recoverable fatal error: Argument 2 passed to RestWSBaseFormat::getResourceReferenceValue() must be of the type array, string given, called in .../restws/restws.formats.inc on line 278 and defined in RestWSBaseFormat->getResourceReferenceValue() line 311
My JSON is:
{
"body": {
"format": "filtered_html",
"summary": "",
"value": "test"
},
"field_opening_times_t": {
"format": "filtered_html",
"value": "Daily"
},
"field_price_category": "",
"field_price_text_t": {
"format": "filtered_html",
"value": "<p>Free entry</p>"
},
"title": "Mark test test test",
"type": "primary_article"
}
The field is a List(text) and the widget type is Check boxes/radio buttons. Values are:
Monday|Monday
Tuesday|Tuesday
Wednesday|Wednesday
Thursday|Thursday
Friday|Friday
Saturday|Saturday
Sunday|Sunday
Am I right in thinking it is just an array that should be POSTed?
Any ideas?
field_days_closed_v
in your JSON format!. Where is it? and I'm pretty sure that the JSON format in my answer works for the field type you mentioned. So try to send the exact JSON format (by ignoring other fields) and see. – Krishna Mohan Dec 16 '14 at 10:56