fix_course_sortorder() bug #2509 - Should fix overlaps when moving categories with large gaps -- affects only mysql

This commit is contained in:
martinlanghoff
2005-02-07 09:12:04 +00:00
parent 78e4d1f366
commit ad1908146b
+1 -1
View File
@@ -2121,7 +2121,7 @@ function fix_course_sortorder($categoryid=0, $n=0, $safe=0) {
// if the new sequence overlaps the current sequence, lack of transactions
// will stop us -- shift things aside for a moment...
if ($safe || ($n >= $min && $n+$count+1 < $min && $CFG->dbtype==='mysql')) {
$shift = $n + $count + 100;
$shift = $max + 1000;
execute_sql("UPDATE {$CFG->prefix}course
SET sortorder=sortorder+$shift
WHERE category=$categoryid", 0);