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
Comment | File | Size | Author |
---|---|---|---|
#2 | services-alias-support-2683859-1.patch | 437 bytes | jimkeller |
Comments
Comment #2
jimkeller CreditAttribution: jimkeller commentedComment #3
jimkeller CreditAttribution: jimkeller at Eastern Standard commentedComment #4
jimkeller CreditAttribution: jimkeller at Eastern Standard commentedComment #5
jimkeller CreditAttribution: jimkeller at Eastern Standard commented