mdl_course_categories
表的 sortorder 欄位排序,但大量匯入時若沒指定 sortorder 值,就會造成顯示問題。
[root@moodle course_tree_list]# diff -uwBN ../../../moodle/blocks/course_tree_list/block_course_tree_list.php block_course_tree_list.php --- ../../../moodle/blocks/course_tree_list/block_course_tree_list.php 2013-01-16 17:51:08.000000000 +0800 +++ block_course_tree_list.php 2014-08-06 20:20:12.349242352 +0800 @@ -132,7 +132,7 @@ if (!$courses) { $out .= "Not Enrolled in any courses"; } else { - $query = 'SELECT * FROM '.$CFG->prefix.'course_categories ORDER BY sortorder'; + $query = 'SELECT * FROM '.$CFG->prefix.'course_categories ORDER BY id,path';//sortorder'; $course_categories = $DB->get_records_sql($query); foreach ($course_categories as $cc) {