Quiero crear un nodo usando la REST Console de Chrome, y mediante JSON; para ello analizo el render array de los campos de mi nodo:
Por ejemplo este (no pego todos porque las ramificaciones son casi todas iguales):
Código PHP:
field_public_event_date (Array, 1 element)
und (Array, 1 element)
0 (Array, 4 elements)
value (String, 19 characters ) 2014-12-01 09:30:00
timezone (String, 13 characters ) Europe/Madrid
timezone_db (String, 3 characters ) UTC
date_type (String, 8 characters ) datetime
Código PHP:
{
"type":"public_event",
"title":"testing service",
"field_public_event_description": {
"und": [{
"value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ",
"format": null,
"safe_value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.."
}]
},
"field_public_event_location": [],
"field_public_event_date": {
"und": [{
"value": "2015-12-01 09:30:00",
"timezone": "Europe/Madrid",
"timezone_db": "UTC",
"date_type": "datetime"
}]
},
"field_public_event_type": {
"und": [{
"tid": "220"
}]
},
"field_public_event_photo": {
"filename": "dsm.png",
"uri": "public://dsm.png",
"filemime": "image/png",
"filesize": "68685",
"image_dimensions": {
"width": "814",
"height": "429"
}
}
}
{"field_public_event_description":
{"und":
{"value":"2014-12-01 09:30:00","timezone":"Europe\/Madrid","timezone_db":"UTC","date_type":"datetime"}
}
}
Y aún así me arroja estos errores:
Código PHP:
{
"form_errors": {
"field_public_event_description][und][0][value": "Descripci\u00f3n field is required.",
"field_public_event_date][und][0][value": "A valid date is required for <em class=\"placeholder\">Cu\u00e1ndo</em>.",
"field_public_event_type][und": "Qu\u00e9 field is required.",
"field_public_event_photo][und][0][upload": "Foto de portada field is required."
}
}
Disculpen, por error puse este mismo post en el foro de PHP, no se como borrarlo en dicho foro, ya que debe de estar en este de Drupal.
Gracias de antemano.