lib MDL-23880 Added missing field in get_enrolled_sql causing errors when capability...
authorSam Hemelryk <sam@moodle.com>
Fri, 20 Aug 2010 02:45:03 +0000 (02:45 +0000)
committerSam Hemelryk <sam@moodle.com>
Fri, 20 Aug 2010 02:45:03 +0000 (02:45 +0000)
lib/accesslib.php

index 3ada126..80540cf 100755 (executable)
@@ -3023,7 +3023,7 @@ function get_enrolled_sql($context, $withcapability = '', $groupid = 0, $onlyact
                 $ctxids = implode(',', $contextids);
                 $roleids = implode(',', array_keys($prohibited));
                 $joins[] = "LEFT JOIN {role_assignments} {$prefix}ra4 ON ({$prefix}ra4.userid = {$prefix}u.id AND {$prefix}ra4.roleid IN ($roleids) AND {$prefix}ra4.contextid IN ($ctxids))";
-                $wheres[] = "{$prefix}ra4 IS NULL";
+                $wheres[] = "{$prefix}ra4.id IS NULL";
             }
 
             if ($groupid) {