From 596728959b7a23d46f1ce2603028c7a8a3d487d3 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Tue, 25 Jan 2005 04:56:29 +0000 Subject: [PATCH] Ensuring correct sortorder at the beginning of the category when creating courses. --- course/edit.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/course/edit.php b/course/edit.php index f7ea01cada4..e4bacab4cb1 100644 --- a/course/edit.php +++ b/course/edit.php @@ -77,6 +77,11 @@ //For topics and weeks formats (default built in the function) $form->blockinfo = blocks_get_default_blocks(); } + + // 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 $section = NULL;