From: martinlanghoff Date: Tue, 25 Jan 2005 05:03:43 +0000 (+0000) Subject: Merged from MOODLE_14_STABLE - Ensuring correct sortorder at the beginning of the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=acba70d2dbef39ff610c54e3fce29a112d7e6b63;p=moodle.git Merged from MOODLE_14_STABLE - Ensuring correct sortorder at the beginning of the category when creating courses. --- 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