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

Course restore fails if a disabled enrolment method is on course prior to restore.

XMLWordPrintable

    • MOODLE_403_STABLE

      The following causes a coding error to be displayed.

      1. Create a course.
      2. Allow guest enrolment on the course.
      3. Globally disable the guest enrolment method.
      4. Restore an mbz to the course.

      The issue is in lib/enrollib.php, function enrol_course_delete(). This calls member function allow_unenrol on object $plugins[$instance->enrol] . However with guest enrolment globally disabled, there is no $plugins[ 'guest' ], so this fails with "Exception - Call to a member function allow_unenrol() on null".
       
      The issue occurs even if there are no guests enrolled on the course, and even there is a guest enrolment method on the course which is disabled.

        1. backup-moodle2-course-5-david-20241118-1311.mbz
          6 kB
          David Norman
        2. BC (1) -- (404)MDL-83732.png
          51 kB
          Kim Jared Lucas
        3. course_restore_error_screenshot.png
          43 kB
          David Norman

            Unassigned Unassigned
            DavidNorman99 David Norman
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.