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

Improve "Cannot find file with external function implementation" exception

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Minor
    • None
    • 3.1
    • Web Services
    • MOODLE_31_STABLE

    Description

      While creating a new web service and adding new functions to it, I got the following error/exception "Cannot find file with external function implementation" due to erroneous "externallib.php" file from one of the contrib plugins installed on my system.

      The exception does not show which plugin was causing this error, and so I added the full reference to the problematic missing file to the output of the exception.

      It seems easy and trivial to add this improvement to the code, especially for cases where the system admin can see what is causing the error and remove/disable the problematic plugin without the immediate need for a developer. (Obviously, it should ultimately be solved by a developer with access to the code)

      Suggested patch:

      // https://github.com/moodle/moodle/blob/master/lib/externallib.php#L87
      if (!file_exists($function->classpath)) {
        throw new coding_exception('Cannot find file with external function implementation = '.$function->classpath);
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nadavkav Nadav Kavalerchik
              Votes:
              8 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: