Merged from MOODLE_14_STABLE - Ensuring correct sortorder at the beginning of the category when creating courses.

This commit is contained in:
martinlanghoff
2005-01-25 05:03:43 +00:00
parent 5f37b628ae
commit acba70d2db
+4
View File
@@ -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