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

Display external function missing file path, when exception occurs


    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.1
    • Web Services
    • None

      Trying to add some functions to a new web service, I got the following error:

      Coding error: Cannot find file with external function implementation
      More info:
      Debug info: 
      Error code: codingerror
      Stack trace:
      line 88 of /lib/externallib.php: coding_exception thrown
      line 199 of /admin/webservice/forms.php: call to external_api::external_function_info()
      line 201 of /lib/formslib.php: call to external_service_functions_form->definition()
      line 60 of /admin/webservice/service_functions.php: call to moodleform->__construct()

      It was hard to tell (without going into the code and adding some extra debugging output) which plugin/file was causing this coding exception.

      Suggesting to output the $function->classpath as part of the exception output.

      btw, eventually, I found I had a missing plugin code from the disk while it was enabled in the DB, which was only partially removed from the system. and the externallib.php was looking for it. obviously, after deleting the "missing from disk" plugin, the exception was gone. So... maybe we should ignore missing plugins while looping the externallib.php of each relevant plugin?

            Unassigned Unassigned
            nadavkav Nadav Kavalerchik
            3 Vote for this issue
            5 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.