diff --git a/backup/restorelib.php b/backup/restorelib.php index c3f0c5d3488..9cad4ed8dfc 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -595,7 +595,7 @@ //Calculate sortorder field $sortmax = get_record_sql('SELECT MAX(sortorder) AS max FROM ' . $CFG->prefix . 'course - WHERE category=' . $course->category) || 1000; + WHERE category=' . $course->category); if (!empty($sortmax->max)) { $course->sortorder = $sortmax->max + 1; unset($sortmax);