diff --git a/ChangeLog b/ChangeLog index 452ff5e1a7..b88ef558a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ phpMyAdmin - ChangeLog - bug #3553551 [GUI] Invalid HTML code in multi submits confirmation form - [interface] Designer sometimes places tables on the top menu - bug #3546277 [core] Call to undefined function __() when config file has wrong permissions +- bug #3540922 [edit] Error searching table with many fields 3.5.2.1 (2012-08-03) - [security] Fixed local path disclosure vulnerability, see PMASA-2012-3 diff --git a/js/tbl_select.js b/js/tbl_select.js index ba144959a4..f0558dcae1 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -53,7 +53,39 @@ $(document).ready(function() { PMA_prepareForAjaxRequest($search_form); - $.post($search_form.attr('action'), $search_form.serialize(), function(response) { + var values = {}; + $search_form.find(':input').each(function() { + var $input = $(this); + if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') { + if ($input.is(':checked')) { + values[this.name] = $input.val(); + } + } else { + values[this.name] = $input.val(); + } + }); + var columnCount = $('select[name="param[]"] option').length; + // Submit values only for the columns that have a search criteria + for (var a = 0; a < columnCount; a++) { + if (values['fields[' + a + ']'] == '') { + delete values['fields[' + a + ']']; + delete values['func[' + a + ']']; + delete values['names[' + a + ']']; + delete values['types[' + a + ']']; + delete values['collations[' + a + ']']; + } + } + // If all columns are selected, use a single parameter to indicate that + if (values['param[]'] != null) { + if (values['param[]'].length == columnCount) { + delete values['param[]']; + values['displayAllColumns'] = true; + } + } else { + values['displayAllColumns'] = true; + } + + $.post($search_form.attr('action'), values, function(response) { PMA_ajaxRemoveMessage($msgbox); if (typeof response == 'string') { // found results diff --git a/tbl_select.php b/tbl_select.php index 81ca73403a..5e5114feee 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -33,7 +33,7 @@ $geom_types = PMA_getGISDatatypes(); /** * Not selection yet required -> displays the selection form */ -if (! isset($param) || $param[0] == '') { +if ((! isset($param) || $param[0] == '') && ! isset($displayAllColumns)) { // Gets some core libraries include_once './libraries/tbl_common.php'; //$err_url = 'tbl_select.php' . $err_url; @@ -117,7 +117,7 @@ echo PMA_generate_html_tabs(PMA_tbl_getSubTabs(), $url_params, '', 'topmenu2'); -