-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.3.8
-
MOODLE_403_STABLE
The following causes a coding error to be displayed.
- Create a course.
- Allow guest enrolment on the course.
- Globally disable the guest enrolment method.
- 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.