I have two separate custom modules attempting to call hook_default_services_endpoint() and install an end point. However, only one of the two end points is installed.
When I combine both end points into the same hook_default_services_endpoint() in the same module, then both end points are installed.
To recreate this issue:
Create two modules (i.e, module1 and module2).
Create two end points using the Services user interface.
Export each endpoint and place one endpoint export code in module1 in module1_default_services_endpoint() and one endpoint export code in module2 in module2_default_services_endpoint() (following the guidelines for creating endpoints in code as outlined in the Services documentation)
Revisit the Services user interface and the two service calls should be "Default" instead of normal. To further test, delete the endpoints to see if they are re-installed. Only one will come back.
Now if you copy and past module2 endpoint export code into module1's module1_default_services_endpoint() in the proper fashion, both end points will appear in the Services UI.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screen Shot 2013-01-30 at 13.58.17.png | 44.58 KB | roam2345 |
Comments
Comment #1
kylebrowning commentedThis is a ctools bug.
Comment #2
gnugu commentedIt works, you just must name the endpoints differently. You can use the same path, though.
and another module:
You will end up with two endpoints with the same path. Or you can chose different paths as well.
Comment #3
roam2345 commentedThe above statement is wrong see attached screen shot, the path is required to be unique.
Comment #4
marcingy commentedThis is a per http://drupal.org/node/1743274#comment-6580126 a won't fix
Comment #5
roam2345 commentedThanks! found the solution for others looking.
hook_services_endpoint_alter(&$export)
That will allow one to alter the service and append any additions.
Comment #6
bogdan1988 commentedWorkaround in #2 works for me fine. Thank you gnugu.