diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index fcba4c1fa8..e6375c2e6b 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -1379,6 +1379,13 @@ class CourseManager $session_id = intval($session_id); $course_code = Database::escape_string($course_code); $where = array(); + + if (empty($order_by)) { + $order_by = 'user.lastname, user.firstname'; + if (api_is_western_name_order()) { + $order_by = 'user.firstname, user.lastname'; + } + } // if the $order_by does not contain 'ORDER BY' we have to check if it is a valid field that can be sorted on if (!strstr($order_by,'ORDER BY')) {