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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user