From 64a7ab3c9d96360283fb43eb2f149607475bf7af Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 22 May 2015 14:34:46 -0400 Subject: [PATCH] bug #4922 "Sort by key" drop-down value is lost Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/DisplayResults.class.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index df79ce46dd..6faec220a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,7 @@ phpMyAdmin - ChangeLog - bug #4910 Slowness due to large number of routines - bug #4913 GROUP_CONCAT shown as GROUPBY_CONCAT in CodeMirror autocomplete + rfe #1242 Work with --skip-grant-tables +- bug #4922 "Sort by key" drop-down value is lost 4.4.8.0 (not yet released) - bug Allow accessing visual query builder when pmadb is not configured diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 8de7e4f4fd..b822b0e45a 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -1127,7 +1127,7 @@ class PMA_DisplayResults * * @param array $displayParts which elements to display * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression + * @param array $sort_expression sort expression * @param string $sort_expression_nodirection sort expression * without direction * @param string $sort_direction sort direction @@ -1233,7 +1233,7 @@ class PMA_DisplayResults * * @param array &$displayParts which elements to display * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression + * @param array $sort_expression sort expression * @param string $sort_expression_nodirection sort expression * without direction * @param string $sort_direction sort direction @@ -1265,9 +1265,13 @@ class PMA_DisplayResults // can the result be sorted? if ($displayParts['sort_lnk'] == '1') { + // At this point, $sort_expression is an array but we only verify + // the first element in case we could find that the table is + // sorted by one of the choices listed in the + // "Sort by key" drop-down list($unsorted_sql_query, $drop_down_html) = $this->_getUnsortedSqlAndSortByKeyDropDown( - $analyzed_sql, $sort_expression + $analyzed_sql, $sort_expression[0] ); $table_headers_html .= $drop_down_html; @@ -1930,7 +1934,7 @@ class PMA_DisplayResults * Prepare parameters and html for sorted table header fields * * @param array $fields_meta set of field properties - * @param string $sort_expression sort expression + * @param array $sort_expression sort expression * @param string $sort_expression_nodirection sort expression without direction * @param integer $column_index the index of the column * @param string $unsorted_sql_query the unsorted sql query @@ -2027,7 +2031,7 @@ class PMA_DisplayResults /** * Prepare parameters and html for sorted table header fields * - * @param string $sort_expression sort expression + * @param array $sort_expression sort expression * @param string $sort_expression_nodirection sort expression without direction * @param string $sort_tbl The name of the table to which * the current column belongs to