diff --git a/lib.php b/lib.php index 2237cfa..2d1566f 100644 --- a/lib.php +++ b/lib.php @@ -848,14 +848,12 @@ function choicegroup_get_choicegroup($choicegroupid) { $grpfilter = "AND grp_o.groupid = :groupid"; } - $castorderby = ($sortcolumn == 'name') ? "CAST(REGEXP_SUBSTR($sortcolumn, '[0-9]+') AS UNSIGNED)," : ""; - $sql = "SELECT grp_m.id grpmemberid, grp_m.userid, grp_o.id, grp_o.groupid, grp_o.maxanswers FROM {groups} grp INNER JOIN {choicegroup_options} grp_o on grp.id = grp_o.groupid LEFT JOIN {groups_members} grp_m on grp_m.groupid = grp_o.groupid WHERE grp_o.choicegroupid = :choicegroupid $grpfilter - ORDER BY $castorderby $sortcolumn ASC"; + ORDER BY $sortcolumn ASC"; $rs = $DB->get_recordset_sql($sql, $params);