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

admin/webservice/documentation.php doesn't gracefully handle missing plugins

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79205-401
    • Hide
      1. Open ./user/classes/external/update_user_device_public_key.php in your preferred editor
      2. insert a deliberate syntax error, for example change the class lin eto the following:

        class update_user_device_public_key extends external_api child class ooops I made a mistake {
        

      3. Run the following query to insert bogus data into your {external_functions} table:

        INSERT INTO `moodle`.`mdl_external_functions` (`name`, `classname`, `methodname`, `component`, `capabilities`) VALUES ('mod_invalid_get_foo', 'mod_invalid\\external\\get_foo', 'execute', 'mod_invalid', '');
        

      4. Navigate to Server > Web services > API documentation in site administration
      5. Confirm the page loads without exceptions
      6. Confirm presence of an error, which reads as follows:

        Coding error detected, it must be fixed by a programmer: Cannot find file /externallib.php with external function implementation
        

      Show
      Open ./user/classes/external/update_user_device_public_key.php in your preferred editor insert a deliberate syntax error, for example change the class lin eto the following: class update_user_device_public_key extends external_api child class ooops I made a mistake { Run the following query to insert bogus data into your { external_functions } table: INSERT INTO `moodle`.`mdl_external_functions` (`name`, `classname`, `methodname`, `component`, `capabilities`) VALUES ('mod_invalid_get_foo', 'mod_invalid\\external\\get_foo', 'execute', 'mod_invalid', ''); Navigate to Server > Web services > API documentation in site administration Confirm the page loads without exceptions Confirm presence of an error, which reads as follows: Coding error detected, it must be fixed by a programmer: Cannot find file /externallib.php with external function implementation

      If you have missing plugins then the api documentation page explodes:

      Coding error detected, it must be fixed by a programmer: Cannot find file /externallib.php with external function implementation

      While obviously the schema should be aligned, it is not uncommon and the api docs should just work and display what is can and expose any errors that are useful

            pholden Paul Holden
            brendanheywood Brendan Heywood
            Brendan Heywood Brendan Heywood
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 16 minutes
                1h 16m

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