From 6094e6c644a50519731b9413f6e7c4418747d65e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 8 Jan 2011 15:14:00 -0500 Subject: [PATCH] - Bug #3151925 Page selector dropdown broken with ORDER BY query - PMA_pageselector() had an unused parameter --- browse_foreigners.php | 6 ------ js/sql.js | 5 +++-- libraries/common.lib.php | 5 +---- libraries/display_tbl.lib.php | 8 ++++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/browse_foreigners.php b/browse_foreigners.php index a936d6081..be68981ca 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -59,12 +59,6 @@ if (is_array($foreignData['disp_row'])) { if ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) { $gotopage = PMA_pageselector( - 'browse_foreigners.php?field=' . urlencode($field) . - '&' . PMA_generate_common_url($db, $table) - . $rownumber_param . - '&fieldkey=' . (isset($fieldkey) ? urlencode($fieldkey) : '') . - '&foreign_filter=' . (isset($foreign_filter) ? urlencode($foreign_filter) : '') . - '&', $session_max_rows, $pageNow, $nbTotalPage, diff --git a/js/sql.js b/js/sql.js index 53d6a292d..e985be21c 100644 --- a/js/sql.js +++ b/js/sql.js @@ -295,11 +295,12 @@ $(document).ready(function() { event.preventDefault(); PMA_ajaxShowMessage(); + var $the_form = $(this).parent("form"); - $.get($(this).attr('href'), $(this).serialize() + '&ajax_request=true', function(data) { + $.post($the_form.attr('action'), $the_form.serialize() + '&ajax_request=true', function(data) { $("#sqlqueryresults").html(data); $("#sqlqueryresults").trigger('appendAnchor'); - }) // end $.get() + }) // end $.post() })// end Paginate results with Page Selector /** diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0e8a70c56..39764316f 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2173,9 +2173,7 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, /** * Generate a pagination selector for browsing resultsets * - * @todo $url is not javascript escaped!? * @uses range() - * @param string URL for the JavaScript * @param string Number of rows in the pagination set * @param string current page number * @param string number of total pages @@ -2195,7 +2193,7 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, * * @access public */ -function PMA_pageselector($url, $rows, $pageNow = 1, $nbTotalPage = 1, +function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1, $showAll = 200, $sliceStart = 5, $sliceEnd = 5, $percent = 20, $range = 10, $prompt = '') { @@ -2320,7 +2318,6 @@ function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_cou echo "\n", '
', "\n"; echo PMA_generate_common_hidden_inputs($_url_params); echo PMA_pageselector( - $script . PMA_generate_common_url($_url_params) . '&', $max_count, floor(($pos + 1) / $max_count) + 1, ceil($count / $max_count)); diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index ca569559e..53c610b76 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -370,8 +370,6 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', ' - for keep the form alignment of button < and << ?> - $db, @@ -379,9 +377,11 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', ' $sql_query, 'goto' => $goto, ); + // to keep the form alignment of button < and << + // and also to know what to execute when the selector changes + echo ''; echo PMA_pageselector( - 'sql.php' . PMA_generate_common_url($_url_params) . PMA_get_arg_separator('js'), - $_SESSION['tmp_user_values']['max_rows'], + $_SESSION['tmp_user_values']['max_rows'], $pageNow, $nbTotalPage, 200,