-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.3.3, 3.9.1
-
None
-
MOODLE_33_STABLE, MOODLE_39_STABLE
If a plugin does not exist in the file system when API Documentation is loaded the LMS returns:
Coding error detected, it must be fixed by a programmer: Cannot find file with external function implementation
More information about this error
×Debug info:
Error code: codingerror
×Stack trace: * line 87 of /lib/externallib.php: coding_exception thrown
- line 39 of /admin/webservice/documentation.php: call to external_api::external_function_info()
in admin/webservice/documentation.php on lines 33 to 41 should look like:
$functions = $DB->get_records('external_functions', array(), 'name');
foreach ($functions as $function) {
$component = $function->component;
$info = core_plugin_manager::instance()->get_plugin_info($component);
if(file_exists($info->typerootdir.'/'.$info->name) || $info->component == 'moodle') {
$functiondescs[$function->name] = external_api::external_function_info($function);
}}
Where the plugin CHECKS if the plugin exists in infrastructure prior to loading the API