Skip to content

Commit

Permalink
Merged from MOODlE_14_STABLE: Fix for invalid sql (for postgres) in c…
Browse files Browse the repository at this point in the history
…ron cleanup of duplicate enrolments. Possibly soon to be overridden by a unique index
  • Loading branch information
mjollnir_ committed Nov 23, 2004
1 parent 8b19b04 commit df7ebd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/cron.php
Expand Up @@ -103,9 +103,9 @@
/// Delete duplicate enrolments (don't know what causes these yet - expired sessions?)

if ($users = get_records_select("user_students", "userid > 0 GROUP BY course, userid ".
"HAVING count(*) > 1", "", "*,count(*)")) {
"HAVING count(*) > 1", "", "max(id) as id, userid, course ,count(*)")) {
foreach ($users as $user) {
delete_records_select("user_students", "userid = '$user->userid' ".
delete_records_select("user_students", "userid = '$user->userid' ".
"AND course = '$user->course' AND id <> '$user->id'");
}
}
Expand Down

0 comments on commit df7ebd6

Please sign in to comment.