#4434 (ok 4.2.3) Unchecking 'Show SQL queries' results NaN

4.2.2
fixed
1
2014-06-08
2014-05-28
timo
No

In appearance settings, select tab 'SQL Queries'.
Uncheck 'Show SQL queries'.
Then click Home-icon on navigation panel and edit some table.
Instead of SQL query a 'NaN' is displayed.

phpMyAdmin 4.2.2.

1 Attachments

Discussion

  • timo

    timo - 2014-05-28

    Perhaps a small change in line 1021 in libraries/Util.class.php
    $retval .= '<div id="result_query"'
    $retval .= '<div class="result_query"'

     
    Last edit: timo 2014-05-29
  • Marc Delisle

    Marc Delisle - 2014-05-29

    Thanks, but removing this id has a side effect: the UPDATE query is no longer shown when grid editing.

     
  • timo

    timo - 2014-05-29

    Ok, I had an idea that that might not be the final solution.
    Anyway, 'Nan' should not be displayed after grid edit when SQL query is not shown.

     
    Last edit: timo 2014-05-29
  • timo

    timo - 2014-05-29

    How about js/makegrid.js, starting from line 1284 ?
    There is an additonal check if (sqlOuter)

    if (typeof data.sql_query != 'undefined') {
        //extract query box
        var $result_query = $($.parseHTML(data.sql_query));
        var sqlOuter = $result_query.find('.sqlOuter').wrap('<p>').parent().html();
        var tools = $result_query.find('.tools').wrap('<p>').parent().html();
        // add check to see if there is any query box available
        if (sqlOuter) {
            // 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'));
         }
    }
    
     
    Last edit: timo 2014-05-30
  • Madhura Jayaratne

    • assigned_to: Madhura Jayaratne
     
  • Madhura Jayaratne

    • summary: Unchecking 'Show SQL queries' results NaN --> (ok 4.2.3) Unchecking 'Show SQL queries' results NaN
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2014-06-08
    • Status: resolved --> fixed