API page: http://api.drupal.org/api/drupal/core%21modules%21xmlrpc%21xmlrpc.server...

Enter a descriptive title (above) relating to function xmlrpc_server, then describe the problem you have found:

The parameter to xmlrpc_server() appears to be a complex array, but it is not documented.

CommentFileSizeAuthor
#16 d7-document_parameter_xmlrpc_server-1956782-16.patch607 bytesjoshi.rohit100
PASSED: [[SimpleTest]]: [MySQL] 41,243 pass(es). View
#12 document_parameter_xmlrpc_server-1956782-12.patch714 bytesbdimaggio
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,507 pass(es). View
#10 document_parameter_xmlrpc_server-1956782-10.patch713 bytesbdimaggio
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,945 pass(es). View
#6 1956782-6-document_parameter_xmlrpc_server.patch822 bytestanmayk
PASSED: [[SimpleTest]]: [MySQL] 40,374 pass(es). View
#2 1956782-document_parameter_xmlrpc_server.patch604 byteschertzog
PASSED: [[SimpleTest]]: [MySQL] 55,491 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

jhodgdon’s picture

Looking at the code, it appears that you can pass in callbacks as documented there (it's not *well-written* documentation, but it is implied that the array key is the xml-rpc name and the value is the name of the callback function, and that is correct as far as I can tell). Or you can do something more complex. You are probably right that the documentation should be fixed up.

chertzog’s picture

Status: Active » Needs review
FileSize
604 bytes
PASSED: [[SimpleTest]]: [MySQL] 55,491 pass(es). View

here is a simple attempt.

jhodgdon’s picture

Status: Needs review » Needs work

That's a good start!

Looking at the one calling function for this, it passes in the result of invoking:
http://api.drupal.org/api/drupal/core!modules!xmlrpc!xmlrpc.api.php/func...
on all modules.

That hook already has extensive docs on the return value structure. So maybe we could just say here "Either (what you wrote in the patch) or a more complex structure describing XMLRPC callbacks as returned from hook_xmlrpc()." or something like that?

lokapujya’s picture

Status: Needs work » Closed (won't fix)

The one function that calls this has a comment: @deprecated Use \Drupal\xmlrpc\Controller\XmlrpcController::php().
The one place that calls the deprecated function has a @todo Remove xmlrpc_server_page().

joachim’s picture

Version: 8.x-dev » 7.x-dev
Status: Closed (won't fix) » Active

Fair enough, though this needs doing on D7.

tanmayk’s picture

Assigned: Unassigned » tanmayk
Issue summary: View changes
Status: Active » Needs review
FileSize
822 bytes
PASSED: [[SimpleTest]]: [MySQL] 40,374 pass(es). View

Patch against 7.x.

joachim’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work

> The one function that calls this has a comment: @deprecated Use \Drupal\xmlrpc\Controller\XmlrpcController::php().
> The one place that calls the deprecated function has a @todo Remove xmlrpc_server_page().

I think this still needs documenting on D8, regardless of the above.

XmlrpcController::php() calls xmlrpc_server_page(), which calls xmlrpc_server(). And we don't ever know if @todos will actually get done this cycle!

Howevever, it does look like the array that xmlrpc_server() expects is the same kind of thing that https://api.drupal.org/api/drupal/core!modules!xmlrpc!xmlrpc.api.php/fun... returns, so we could maybe just refer to that?

bdimaggio’s picture

I think joachim's suggestion makes sense. I'll submit a patch accordingly in a minute.

bdimaggio’s picture

Assigned: tanmayk » bdimaggio
bdimaggio’s picture

Status: Needs work » Needs review
FileSize
713 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,945 pass(es). View

Took jhodgdon's suggestion (#3) as well as joachim's (#7).

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine to me, thanks!

bdimaggio’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
714 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 72,507 pass(es). View

OK, maybe being perfectionist, but I noticed that I called it "XML-RPC" the first time and "XMLRPC" the second. "Fixing" that. Sorry to force an extra round of review, jhodgdon...

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Perfectionism is fine. :)

  • Commit d142a21 on 8.x by jhodgdon:
    Issue #1956782 by bdimaggio, tanmayk, chertzog: Document parameter...
jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 8.x. Thanks again!

Now we need to go back to 7.x and figure out what to do there. There was a patch on #6... it seems like the 8.x patch would be a better starting point (assuming 7.x works the same)?

joshi.rohit100’s picture

Status: Patch (to be ported) » Needs review
FileSize
607 bytes
PASSED: [[SimpleTest]]: [MySQL] 41,243 pass(es). View

d7 patch.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, and I have also verfied it works this way in 7 (as in 8). Thanks for the patch!

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again all! Committed to 7.x.

  • jhodgdon committed 26c863d on 7.x
    Issue #1956782 by joshi.rohit100, bdimaggio, tanmayk, chertzog: Document...

Status: Fixed » Closed (fixed)

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