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

admin/reports.php broken if plugin doesn't exist on disk but hasn't been uninstalled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.6, 2.9
    • Fix Version/s: 2.8.9, 2.9.3
    • Component/s: Reports
    • Labels:
    • Testing Instructions:
      Hide
      1. Visit administration / ▶︎ Plugins / ▶︎ Reports / ▶︎ Manage reports.
      2. Rename the folder 'report/stats' to 'report/statts'.
      3. Purge caches.
      4. Refresh the page.
      5. VERIFY: the page should not die and list the report as missing from disk.
      6. Rename the report back to 'stats' so you don't forget.
      Show
      Visit administration / ▶︎ Plugins / ▶︎ Reports / ▶︎ Manage reports. Rename the folder 'report/stats' to 'report/statts'. Purge caches. Refresh the page. VERIFY: the page should not die and list the report as missing from disk. Rename the report back to 'stats' so you don't forget.
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull Master Branch:
      MDL-50412-master

      Description

      In cases where a report module has been removed from the disk but not uninstalled, the admin/reports.php fails to load, with a Coding error detected, it must be fixed by a programmer: Invalid component used in plugin/component_callback():report_spidermigration error

      Stack trace: 
       
          line 7540 of /lib/moodlelib.php: coding_exception thrown
          line 162 of /admin/tool/log/classes/log/manager.php: call to component_callback_exists()
          line 83 of /admin/reports.php: call to tool_log\log\manager->get_supported_logstores()
      

      The $logmanager (in report.php) object is getting a list of installed plugins from the DB and then assuming that they exist, and choosing to fail if it doesn't.

      Looking at the code, there is a 3 way choice happening that infers that should a plugin not respond with any supported stores then it should indicate this. However because a coding exception has been thrown (which really is a non-existance issue) it never gets there, and you can't see the rest of the reports because of a single report plugin not existing on the disk but in the database.

        Attachments

          Activity

            People

            Assignee:
            poltawski Dan Poltawski
            Reporter:
            mhughes2k Michael Hughes
            Peer reviewer:
            Mark Nelson
            Integrator:
            Andrew Nicols
            Tester:
            John Okely
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Nov/15