From 9c2d41fce2b775b99c85870097a845293351fca3 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 13 Dec 2012 09:46:36 +0800 Subject: [PATCH] MDL-30700 tablelib: Fixed get_sort_for_table to work with text sorting columns for oracle This change stores the list of columns that require text sorting in the session, so the static function "get_sort_for_table" can work without any additional parameters. --- lib/tablelib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 55f9f0d86b6..ebd4886b0d9 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -419,6 +419,7 @@ class flexible_table { $SESSION->flextable[$this->uniqueid]->sortby = array(); $SESSION->flextable[$this->uniqueid]->i_first = ''; $SESSION->flextable[$this->uniqueid]->i_last = ''; + $SESSION->flextable[$this->uniqueid]->textsort = $this->column_textsort; } $this->sess = &$SESSION->flextable[$this->uniqueid]; @@ -513,8 +514,11 @@ class flexible_table { if (empty($sess->sortby)) { return ''; } + if (empty($sess->textsort)) { + $sess->textsort = array(); + } - return self::construct_order_by($sess->sortby); + return self::construct_order_by($sess->sortby, $sess->textsort); } /**