Closed (won't fix)
Project:
Services
Version:
7.x-3.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2012 at 17:21 UTC
Updated:
29 Feb 2012 at 19:00 UTC
I'm trying to use the Node Update Resource (REST) that comes with the services module and the Drupal Backbone module. Everything goes fine with certain nodes, but if the content type have a date field (created with the help of the date module), it returns the following message:
{"form_errors":["There are errors in Wedding Date value #1:<div class=\"item-list\"><ul><li class=\"first last\">The dates are invalid.</li>\n</ul></div>"]}
Looking into the node_resource.inc file is possible to see that almost all operations with nodes are done using form functions like drupal_form_submit and I believe it's formatting the Date field data in a wrong way.
Modules:
Services 7.x-3.1
Backbone 7.x-1.x-dev
Date 7.x-2.0-rc1
Comments
Comment #1
marcingy commentedYou have to format the date in the way that form widget expects it so this is not a bug in services.
Comment #2
ethanw commentedCan you post the contents of the HTTP request being made to update the node, then JSON returned by the original node load request and console.dir output of the node model and/or it's "attributes" property?
My sense is that if the JSON format returned by services when a node is requested is not the same as the form it expects to update, I could see this being something that could be reasonable addressed on the Services side. But that's ultimately a call for the Services maintainers.
If we need to add better client-side validation or Backbone is doing something to corrupt the dates, or if some transformation is needed to adapt JS dates (which are a bit crazy) into what the Date Field expects, then this should probably be moved to the Backbone issue queue.