Permalink
Browse files

MDL-44046 gradebook Reduce duplicates returned during sortorder fixing.

  • Loading branch information...
1 parent 4f6e4f8 commit 2a2176186d415037e1a2b31f69459fbf848207ae @merrill-oakland merrill-oakland committed Feb 7, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/grade/grade_item.php
View
@@ -1221,7 +1221,7 @@ public static function fix_duplicate_sortorder($courseid) {
$transaction = $DB->start_delegated_transaction();
- $sql = "SELECT g1.id, g1.courseid, g1.sortorder
+ $sql = "SELECT DISTINCT g1.id, g1.courseid, g1.sortorder
FROM {grade_items} g1
JOIN {grade_items} g2 ON g1.courseid = g2.courseid
WHERE g1.sortorder = g2.sortorder AND g1.id != g2.id AND g1.courseid = :courseid

0 comments on commit 2a21761

Please sign in to comment.