Merge branch 'w50_MDL-30528_m23_enrolroleid' of git://github.com/skodak/moodle
authorSam Hemelryk <sam@moodle.com>
Thu, 8 Dec 2011 02:50:42 +0000 (15:50 +1300)
committerSam Hemelryk <sam@moodle.com>
Thu, 8 Dec 2011 02:50:42 +0000 (15:50 +1300)
enrol/database/lib.php

index 306f8b3..33ddad4 100644 (file)
@@ -185,7 +185,7 @@ class enrol_database_plugin extends enrol_plugin {
 
             $existing = array();
             foreach ($current as $r) {
-                if (in_array($r->id, $roles)) {
+                if (in_array($r->roleid, $roles)) {
                     $existing[$r->roleid] = $r->roleid;
                 } else {
                     role_unassign($r->roleid, $user->id, $context->id, 'enrol_database', $instance->id);