]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from MOODLE_14_STABLE - fix_course_sortorder() bug #2509 - Should fix overlaps...
authormartinlanghoff <martinlanghoff>
Tue, 8 Feb 2005 03:42:20 +0000 (03:42 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 8 Feb 2005 03:42:20 +0000 (03:42 +0000)
lib/datalib.php

index 77aed116115928dd9e378d961b98e0f1efdf7008..d5da7e54785bf7ca5c7163143ee44f212d6e97ed 100644 (file)
@@ -2405,7 +2405,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 + $n + 1000;
                 execute_sql("UPDATE {$CFG->prefix}course 
                          SET sortorder=sortorder+$shift 
                          WHERE category=$categoryid", 0);