From acba70d2dbef39ff610c54e3fce29a112d7e6b63 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Tue, 25 Jan 2005 05:03:43 +0000 Subject: [PATCH] Merged from MOODLE_14_STABLE - Ensuring correct sortorder at the beginning of the category when creating courses. --- course/edit.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course/edit.php b/course/edit.php index a0070b11f0..cf131f4d30 100644 --- a/course/edit.php +++ b/course/edit.php @@ -84,6 +84,10 @@ } else { $form->timecreated = time(); + // place at beginning of category + fix_course_sortorder(); + $form->sortorder = get_field_sql("SELECT min(sortorder)-1 FROM {$CFG->prefix}course WHERE category=$form->category"); + if ($newcourseid = insert_record('course', $form)) { // Set up new course // Setup the blocks -- 2.39.5