diff --git a/ChangeLog b/ChangeLog index de5c3a7a77..09095ef5be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog - bug Query error on submitting a column change form containing a disabled input field - bug Incorrect menu tab generation from usergroups - bug Missing space in index creation/edit generated query +- bug #4434 Unchecking 'Show SQL queries' results NaN 4.2.2.0 (2014-05-20) - bug #4388 Disable database expansion when enabled throws Error 500 when database name is clicked in navigation tree diff --git a/js/makegrid.js b/js/makegrid.js index 034c6f3aea..f30371ec73 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -1298,16 +1298,18 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi var $result_query = $($.parseHTML(data.sql_query)); var sqlOuter = $result_query.find('.sqlOuter').wrap('
').parent().html(); var tools = $result_query.find('.tools').wrap('
').parent().html(); - // If two query box exists update query in second else add a second box - if ($('#result_query').find('div.sqlOuter').length>1) { - $('#result_query').children(":nth-child(4)").remove(); - $('#result_query').children(":nth-child(4)").remove(); - $('#result_query').append(sqlOuter+tools); + // sqlOuter and tools will not be present if 'Show SQL queries' configuration is off + if (typeof sqlOuter != 'undefined' && typeof tools != 'undefined') { + // If two query box exists update query in second else add a second box + if ($('#result_query').find('div.sqlOuter').length > 1) { + $('#result_query').children(":nth-child(4)").remove(); + $('#result_query').children(":nth-child(4)").remove(); + $('#result_query').append(sqlOuter + tools); + } else { + $('#result_query').append(sqlOuter + tools); + } + PMA_highlightSQL($('#result_query')); } - else { - $('#result_query').append(sqlOuter+tools); - } - PMA_highlightSQL($('#result_query')); } // hide and/or update the successfully saved cells g.hideEditCell(true, data);