Skip to content
Permalink
Browse files

MDL-44046 gradebook Reduce duplicates returned during sortorder fixing.

  • Loading branch information...
merrill-oakland committed Feb 7, 2014
1 parent a7cae26 commit a48ab57f896ddccf702ca5d5cd6e44a3879b4b94
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/grade/grade_item.php
@@ -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 a48ab57

Please sign in to comment.
You can’t perform that action at this time.