From 77f283992854c66db13476e8294cb9b959e42118 Mon Sep 17 00:00:00 2001 From: Nicolas Dunand Date: Mon, 4 Nov 2024 07:26:09 +0100 Subject: [PATCH] Revert "Adding conditional CAST when ordering by name" This reverts commit 1df683246f5b79d4fc255d863b1aaab5bd8e19db. --- lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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);