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

Cannot delete courses having an assignment after hiding the module

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.5, 3.6.3
    • Fix Version/s: None
    • Component/s: Assignment, Course
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      A course cannot be deleted if you create an Assignment activity and hide the whole module afterwards. I'm not sure if this happens only with Assignment, but I have tested with Quiz & Feedback and there was no errors.

      Might be related to MDL-64878 but this is still a problem in the latest 3.6.3+.

      Steps to reproduce

      1. Create a new course.
      2. Go to the course and add a new Assignment activity.
      3. Go to Site administration > Plugins > Activity modules > Manage activities and hide the Assignment module. Confirm that the module line is greyed out.
      4. Go to Site administration > Courses > Manage courses and categories and try to delete the course you created in step 1.

      Expected result
      The course is deleted.

      Actual result

      The course is not deleted and an error is thrown.

      Error: Invalid course module ID

      Debug info:
      Error code: invalidcoursemodule
      Stack trace:

      line 236 of /lib/modinfolib.php: moodle_exception thrown
      line 1684 of /mod/assign/locallib.php: call to course_modinfo->get_cm()
      line 1617 of /mod/assign/locallib.php: call to assign->get_course_module()
      line 569 of /mod/assign/submission/onlinetext/locallib.php: call to assign->get_instance()
      line 753 of /mod/assign/locallib.php: call to assign_submission_onlinetext->delete_instance()
      line 56 of /mod/assign/lib.php: call to assign->delete_instance()
      line 5109 of /lib/moodlelib.php: call to assign_delete_instance()
      line 4980 of /lib/moodlelib.php: call to remove_course_contents()
      line 67 of /course/delete.php: call to delete_course()

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            artonieminen Arto Nieminen
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m