Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61287

Web Services Documentation fault check when plugin does not exist

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.3.3, 3.9.1
    • None
    • Web Services
    • None
    • MOODLE_33_STABLE, MOODLE_39_STABLE

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dustinbrisebois Dustin Brisebois
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: