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

get_coursemodule_from_instance() doesn't check the module actually exists

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.8.5, 2.9
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
    • Affected Branches:
      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

              Assignee:
              Unassigned
              Reporter:
              howardsmiller Howard Miller
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: