MDL-87945 webservice: handle invalid functions when adding to service.

Same thing as we did for API docs in 6e9e73aba0.
This commit is contained in:
Paul Holden
2026-02-12 16:05:25 +00:00
parent e1c3872f65
commit fa189b24da
+6 -2
View File
@@ -196,8 +196,12 @@ class external_service_functions_form extends moodleform {
//we add the descriptions to the functions
foreach ($functions as $functionid => $functionname) {
//retrieve full function information (including the description)
$function = \core_external\external_api::external_function_info($functionname);
if (empty($function->deprecated)) {
try {
$function = \core_external\external_api::external_function_info($functionname);
} catch (Throwable $exception) {
$function = null;
}
if ($function !== null && empty($function->deprecated)) {
$functions[$functionid] = $function->name . ':' . $function->description;
} else {
// Exclude the deprecated ones.