From fcfe9aaa2afed86b72bb39907eda03c3152cac70 Mon Sep 17 00:00:00 2001 From: Stephane Proulx Date: Sat, 24 Nov 2018 20:49:00 -0400 Subject: [PATCH] Change expected variable to array instead of string Whole array of sort expressions needed to correctly build "sort by key" drop down menu Fixes bug #14339 Signed-off-by: Stephane Proulx --- libraries/classes/Display/Results.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libraries/classes/Display/Results.php b/libraries/classes/Display/Results.php index 2d815eff8e..28195ae276 100644 --- a/libraries/classes/Display/Results.php +++ b/libraries/classes/Display/Results.php @@ -1344,8 +1344,8 @@ class Results /** * Prepare unsorted sql query and sort by key drop down * - * @param array $analyzed_sql_results analyzed sql results - * @param string $sort_expression sort expression + * @param array $analyzed_sql_results analyzed sql results + * @param array|null $sort_expression sort expression * * @return array two element array - $unsorted_sql_query, $drop_down_html * @@ -1354,7 +1354,7 @@ class Results * @see _getTableHeaders() */ private function _getUnsortedSqlAndSortByKeyDropDown( - array $analyzed_sql_results, $sort_expression + array $analyzed_sql_results, array $sort_expression ) { $drop_down_html = ''; @@ -1389,9 +1389,9 @@ class Results /** * Prepare sort by key dropdown - html code segment * - * @param Index[] $indexes the indexes of the table for sort criteria - * @param string $sort_expression the sort expression - * @param string $unsorted_sql_query the unsorted sql query + * @param Index[] $indexes the indexes of the table for sort criteria + * @param array|null $sort_expression the sort expression + * @param string $unsorted_sql_query the unsorted sql query * * @return string $drop_down_html html content * @@ -1400,7 +1400,7 @@ class Results * @see _getTableHeaders() */ private function _getSortByKeyDropDown( - $indexes, $sort_expression, $unsorted_sql_query + $indexes, array $sort_expression, $unsorted_sql_query ) { $drop_down_html = ''; @@ -1415,7 +1415,7 @@ class Results . ':