I am using vinculum to send/receive ping/trackbacks between two Drupal sites. It requires xmlrpc to work for pingback.ping.
It tries to hit http://server.com/xmlrpc.php and gets a 500 PHP error. This is the same error in http://drupal.org/node/1260524 however it is not working as designed, or there is some weird configuration that is required somewhere to define an endpoint.
The function that is needed is in services.runtime.inc, which doesn't seem to be included in the normal execution path of a generic request for XML-RPC services.
Error message:
<br />
<b>Fatal error</b>: Call to undefined function services_get_server_info() in <b>modules/services/servers/xmlrpc_server/xmlrpc_server.module</b> on line <b>42</b><br />
The line is:
$resources = services_get_resources(services_get_server_info('endpoint', ''));
I changed it to this quick, and now the script runs without an error. For some reason services.runtime.inc is not being included in a normal request to xmlrpc.php. I'd submit a patch but this is probably not the best place to put this call, it's almost impossible to find the right spot for it though, and this seems like services.runtime.inc should be included in any service module related request anyway.
module_load_include('runtime.inc', 'services');
$resources = services_get_resources(services_get_server_info('endpoint', ''));
Comments
Comment #1
thursdasy commentedI can confirm I ran into the same problem with a vanilla installation and the above 'include' resolved the 500 error returned. I was getting the following error when attempting to do any basic xmlrpc request. Here is what is found in apache error.log:
[Fri Dec 16 12:39:53 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function services_get_server_info() in /var/www/drupal/modules/services/servers/xmlrpc_server/xmlrpc_server.module on line 41
My steps to reproduce are just install Drupal(7.10), Services(7.x-3.1), and then enable XMLRPC Server(7.x-3.1) and try to make any request and it will fail.
Comment #2
kylebrowning commentedComment #3
mike503 commentedKyle,
Can you confirm which version it was fixed in/the diff or patch or some other reference?
Thanks
Comment #4
kylebrowning commentedIt was fixed in both 6.x and 7.x
http://drupalcode.org/project/services.git/commit/9b556fd
http://drupalcode.org/project/services.git/commit/8df0b23
Comment #5
mike503 commentedAh, was that the appropriate fix? It was just a hack I threw in on mine. It seemed like that include should be included for the majority of service calls.
oh and when does it get baked into an official drupal.org release?
i am new to the process of when things get baked in.
Comment #7
dgtlmoon commentedYes this fixed my issues, probably could do with making a new release
interestingly I only hit this bug when I started accessing the Drupal stack from a different hostname
Comment #7.0
dgtlmoon commentedClarified some details