Permalink
Browse files

MDL-28348 fix fatal error caused by unenrolling of incorrect enrol in…

…stance
  • Loading branch information...
skodak committed Jul 17, 2011
1 parent ebbc9e7 commit c7f51d2dfe14a18817dc26573b57cad91bbbecf0
Showing with 1 addition and 1 deletion.
  1. +1 −1 enrol/meta/locallib.php
View
@@ -158,7 +158,7 @@ public function user_unenrolled($ue) {
JOIN {user_enrolments} ue ON (ue.enrolid = e.id AND ue.userid = :userid)
JOIN {enrol} pe ON (pe.courseid = e.customint1 AND pe.enrol <> 'meta' AND pe.courseid = :courseid)
LEFT JOIN {user_enrolments} pue ON (pue.enrolid = pe.id AND pue.userid = ue.userid)
- WHERE pue.id IS NULL";
+ WHERE pue.id IS NULL AND e.enrol = 'meta'";
$params = array('courseid'=>$ue->courseid, 'userid'=>$ue->userid);
$rs = $DB->get_recordset_sql($sql, $params);

0 comments on commit c7f51d2

Please sign in to comment.