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

'Invalid Module ID: {$a}' in gradebook singleview if a module has been uninstalled

    Details

    • Testing Instructions:
      Hide
      1. Create a course containing a Quiz and an Assignment.
      2. Go to the singleview gradebook report for any user in that course, and verify that both activities are shown with links that work.
      3. In another browser tab, go to Admin -> Plugins -> Activity modules -> Manage activities and close the eye for mod_assign.
      4. Reload the browser tab showing singeview report.
      5. Verify that there is not a fatal error.
      6. Verify that the link to the quiz still works.
      7. Verify that the assignment is still shown, but without a link.
      Show
      Create a course containing a Quiz and an Assignment. Go to the singleview gradebook report for any user in that course, and verify that both activities are shown with links that work. In another browser tab, go to Admin -> Plugins -> Activity modules -> Manage activities and close the eye for mod_assign. Reload the browser tab showing singeview report. Verify that there is not a fatal error. Verify that the link to the quiz still works. Verify that the assignment is still shown, but without a link.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Steps to reprodce:

      1. Install a Moodle 2.x, for some x that allows you to create an old mod_assignment.
      2. Create a test course with an old-style assignment in it.
      3. Upgrade to Moodle 2.8 or later.
      4. Note that the assignment is not shown on the course page.
      5. Note that in the grade report, the column for the Assignemtn is shown, with no link in the column heading.
      6. Click the Single view icon for any row or column.

      Expect result: Something sensible is displayed.

      Acutal result:

      Error
      
      Invalid module ID: {$a}
      
      More information about this error
      Debug info:
      Error code: invalidmoduleid
      Stack trace:
      
          line 2254 of /lib/modinfolib.php: moodle_exception thrown
          line 117 of /grade/report/singleview/classes/local/screen/user.php: call to get_course_and_cm_from_instance()
          line 90 of /grade/report/singleview/classes/local/screen/screen.php: call to gradereport_singleview\local\screen\user->init()
          line 98 of /grade/report/singleview/lib.php: call to gradereport_singleview\local\screen\screen->__construct()
          line 131 of /grade/report/singleview/index.php: call to gradereport_singleview->__construct()
      

      I expect this happens in any case where you create a graded activity, and then un-install the plugin. (So, most likely with a plugin installed from the plugins DB.)

      See this forum for more details and other reports of the same issue:
      https://moodle.org/mod/forum/discuss.php?d=311573

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    6/Jul/15