From e955d8c3350ee77f6a7dd3842351a274dbe01c99 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 6 Dec 2017 11:53:20 +0100 Subject: [PATCH] Fix sql error when "course.title" is present in order by --- main/inc/lib/course.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 777b5a181a..af898adf12 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -2746,7 +2746,7 @@ class CourseManager if ($adminGetsAllCourses && UserManager::is_admin($user_id)) { // get the whole courses list - $sql = "SELECT DISTINCT(course.code), course.id as real_id + $sql = "SELECT DISTINCT(course.code), course.id as real_id, course.title FROM $tbl_course course INNER JOIN $tableCourseUrl url ON (course.id = url.c_id) @@ -2769,7 +2769,8 @@ class CourseManager if (!empty($withSpecialCourses)) { $sql = "SELECT DISTINCT (course.code), course.id as real_id, - course.category_code AS category + course.category_code AS category, + course.title FROM $tbl_course_user course_rel_user LEFT JOIN $tbl_course course ON course.id = course_rel_user.c_id @@ -2799,7 +2800,8 @@ class CourseManager $sql = "SELECT DISTINCT(course.code), course.id as real_id, - course.category_code AS category + course.category_code AS category, + course.title FROM $tbl_course course INNER JOIN $tbl_course_user cru ON (course.id = cru.c_id)