From 5875a2f3cac92d214366d1c735826fa20b00a85f Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 23 Feb 2005 04:49:15 +0000 Subject: [PATCH] Merged from MOODLE_14_STABLE - Fix problem when restoring courses to empty categories --- backup/restorelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/restorelib.php b/backup/restorelib.php index 9cad4ed8dfc..c3f0c5d3488 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); + WHERE category=' . $course->category) || 1000; if (!empty($sortmax->max)) { $course->sortorder = $sortmax->max + 1; unset($sortmax);