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

get_coursemodule_from_instance() doesn't check the module actually exists

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8.5, 2.9
    • None
    • Libraries
    • MOODLE_28_STABLE, MOODLE_29_STABLE

    Description

      We had an issue where a module did not clean up its grades when deleted (turnitintool to name and shame). This leaves a load of records in the mdl_grade_items table relating to a module that doesn't exist.

      It would have saved some debugging if the get_coursemodule_from_instance() function made a check that the requested modulename is actually installed on the system. If a modulename is given to this function that is not installed (for whatever reason) it attempts to do a db join on the module table which doesn't exist. It seems prudent (to me) that this check should be made.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              howardsmiller Howard Miller
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: