Merged from MOODLE_14_STABLE - Fix problem when restoring courses to empty categories
This commit is contained in:
@@ -595,7 +595,7 @@
|
||||
//Calculate sortorder field
|
||||
$sortmax = get_record_sql('SELECT MAX(sortorder) AS max
|
||||
FROM ' . $CFG->prefix . 'course
|
||||
WHERE category=' . $course->category);
|
||||
WHERE category=' . $course->category) || 1000;
|
||||
if (!empty($sortmax->max)) {
|
||||
$course->sortorder = $sortmax->max + 1;
|
||||
unset($sortmax);
|
||||
|
||||
Reference in New Issue
Block a user