From fee755bbfac46c9b51a3dad53b0b826311eeadfd Mon Sep 17 00:00:00 2001 From: Alex Morris Date: Fri, 30 Sep 2022 11:29:27 +1300 Subject: [PATCH] MDL-75170 tablelib: Use sql_order_by_null to sort columns --- lib/tablelib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 70138797506..4099fd5fe97 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -601,9 +601,9 @@ class flexible_table { $column = $DB->sql_order_by_text($column); } if ($order == SORT_ASC) { - $bits[] = $column . ' ASC'; + $bits[] = $DB->sql_order_by_null($column); } else { - $bits[] = $column . ' DESC'; + $bits[] = $DB->sql_order_by_null($column, SORT_DESC); } }