Using Services > Browse > Servers > RES- /services/rest lead to HPH error :

Fatal error: Call to undefined function services_resource_uri_formatter() in ../sites/all/modules/rest_server/includes/RESTServer.inc on line 16

Comments

freelock’s picture

See http://drupal.org/node/466922 - I ran into this same error. After applying the patch in that issue, I no longer got the error, but it can't find any resources to handle any requests --

In RESTServer.inc RESTServer::resolveController, the $resource array contains only a single member, '#action'. So this method always returns null, since it's looking for '#index','#retrieve','#create', etc. The $resource array is originally built by the patched Service module, in services.resource-translation.inc, _services_services_as_resources(), line 70 adds only '#action' items to the array that ends up in resolveController.

Is there any documentation for what structure the resources should contain, and how this maps to services?

Anonymous’s picture

Thx for your answer.

Applying the patch make the PHP error disappear.
But now we are at the same point !

freelock’s picture

I did get this working, for nodes anyway. And built a custom service_resource module for my needs.

The working code isn't on drupal.org though--follow Hugo's links to github to get his patched service module and rest_server. The service module has some changes he's submitted as an issue, but it's deferred for a while--the github version has the necessary changes and a sample node service. Good stuff.

Note that to do any searches on the node index, you also need his query_builder module...

Anonymous’s picture

Status: Active » Fixed

I've just updated both services and rest server : no fatal !

But I still can't obtain response from services. But that's an other story.

Status: Fixed » Closed (fixed)

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