From e7d3e042fc1338d53e812505622fbc2b1359b8e6 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 25 Oct 2022 19:11:30 +0200 Subject: [PATCH] MDL-76052 webservice_xmlrpc: Annotate some wrong plugin uses It has been detected that there are various uses of the plugins breaking the inter-communication principles, with core_webservice implementing functionality plugin-dependent that should belong to the plugins. Because of that, https://tracker.moodle.org/browse/MDL-76078 has been created and we have added some TODO/@todo comments in core pointing to that issue, for further analysis and fixes there. --- admin/webservice/documentation.php | 2 ++ webservice/renderer.php | 6 ++++++ webservice/wsdoc.php | 2 ++ 3 files changed, 10 insertions(+) diff --git a/admin/webservice/documentation.php b/admin/webservice/documentation.php index 329a4101bf9..9ccca8b14eb 100644 --- a/admin/webservice/documentation.php +++ b/admin/webservice/documentation.php @@ -36,6 +36,8 @@ foreach ($functions as $function) { $functiondescs[$function->name] = external_api::external_function_info($function); } +// TODO: MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this. + //display the documentation for all documented protocols, //regardless if they are activated or not $protocols = array(); diff --git a/webservice/renderer.php b/webservice/renderer.php index 5a2d08e3264..381d313604b 100644 --- a/webservice/renderer.php +++ b/webservice/renderer.php @@ -497,6 +497,8 @@ EOF; /** * Create indented XML-RPC param description * + * @todo MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this. + * * @param external_description $paramdescription the description structure of the web service function parameters * @param string $indentation Indentation in the generated HTML code; should contain only spaces. * @return string the html to diplay @@ -575,6 +577,8 @@ EOF; /** * Return indented REST param description * + * @todo MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this. + * * @param external_description $paramdescription the description structure of the web service function parameters * @param string $paramstring parameter * @return string the html to diplay @@ -620,6 +624,8 @@ EOF; /** * Displays all the documentation * + * @todo MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this. + * * @param array $functions external_description of all the web service functions * @param boolean $printableformat true if we want to display the documentation in a printable format * @param array $activatedprotocol the currently enabled protocol diff --git a/webservice/wsdoc.php b/webservice/wsdoc.php index 92098b22655..c5c66a52fe7 100644 --- a/webservice/wsdoc.php +++ b/webservice/wsdoc.php @@ -68,6 +68,8 @@ foreach ($functions as $function) { $functiondescs[$function->name] = external_api::external_function_info($function); } +// TODO: MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this. + // get activated protocol $activatedprotocol = array(); $activatedprotocol['rest'] = webservice_protocol_is_enabled('rest');