get_my_courses() was failing if called with an empty sortorder on a
cached courselist. Fix.
$fields = $basefields;
}
+ $orderby = '';
+ $sort = trim($sort);
+ if (!empty($sort)) {
+ $orderby = "ORDER BY $sort";
+ }
+
//
// Logged-in user - Check cached courses
//
JOIN {$CFG->prefix}context ctx
ON (c.id=ctx.instanceid AND ctx.contextlevel=".CONTEXT_COURSE.")
WHERE c.id IN ($courseids)
- ORDER BY $sort";
+ $orderby";
$rs = get_recordset_sql($sql);
$courses = array();
$cc = 0; // keep count