diff --git a/backup/restorelib.php b/backup/restorelib.php index 82bfa75fe25..302dd522aff 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -547,7 +547,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);