Merged from MOODLE_14_STABLE - Fix problem when restoring courses to empty categories

This commit is contained in:
martinlanghoff
2005-02-23 04:49:15 +00:00
parent ccb3585fdc
commit 5875a2f3ca
+1 -1
View File
@@ -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);