It seems that when using the UUID services module, the resource alias is ignored in certain circumstances. For example: if you have a custom entity with entity type of "this_is_my_entity", and you enable a resources for it with alias of "my_entity", /path/to/api/my_entity/[uuid.json] fails to return anything. This doesn't appear to be the case for core entities like nodes.

After some digging, I traced this issue to the fact that in uuid_services_services_resources_alter, the 'operations' key is set, but the 'endpoint' key is not. The _services_build_resources function looks for the alias in the 'endpoint' key of the array. Since it's not there, no aliased-resource is created, and so it ultimately can't be found.

The following line needs to be called at the end of uuid_services_services_resources_alter:

_services_apply_endpoint($resources, $endpoint, FALSE);

Patch attached

CommentFileSizeAuthor
#2 services-alias-support-2683859-1.patch437 bytesjimkeller
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jimkeller created an issue. See original summary.

jimkeller’s picture

Issue summary: View changes
FileSize
437 bytes
jimkeller’s picture

jimkeller’s picture

Issue summary: View changes
jimkeller’s picture

Title: uuid services does not support resources aliases » uuid services does not support resources aliases in certain conditions