-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
1.8.2
-
None
-
Doesn't matter
-
MySQL
-
MOODLE_18_STABLE
moodle/role:unassignself has been allowed for students so students can unenrol from any course.
It works when student clicks on the link in administration field on course view page. However, when trying to unenrol via the button on profile page an error message appears. Apparently student must have moodle/role:assign allowed
Reason for bug:
if ($userid) on line 31 of file course/unenrol.php always evaluates to true when the script is called via the button on profile page. So the script thinks someone else is about to be unenrolled.
Fix of bug:
Replacing
if ($userid) {
by
if ($userid && $userid != $USER->id) {
on lines 31, 42, and 66 in file course/unenrol.php fixes the bug.
- duplicates
-
MDL-10241 Unenroll from user profile doesn't work properly
-
- Closed
-