diff --git a/ChangeLog b/ChangeLog index 5a9e1b2c0..41779efe5 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-05-13 Garvin Hicking + * footer.inc.php3, querywindow.php3: Fix bug #736197 + (clicking on edit link from a sql-query now switches + to sql tab of the query window) + 2003-05-13 Michal Cihar * left.php3: Fixed displaying of tables with quote in name. diff --git a/footer.inc.php3 b/footer.inc.php3 index 8bd8b67d8..93b366c63 100755 --- a/footer.inc.php3 +++ b/footer.inc.php3 @@ -56,7 +56,15 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) { function focus_querywindow(sql_query) { if (top.frames.queryframe && top.frames.queryframe.querywindow && !top.frames.queryframe.querywindow.closed && top.frames.queryframe.querywindow.location) { - top.frames.queryframe.querywindow.focus(); + if (top.frames.queryframe.querywindow.document.querywindow.querydisplay_tab != 'sql') { + top.frames.queryframe.querywindow.document.querywindow.querydisplay_tab.value = "sql"; + top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = sql_query; + top.frames.queryframe.querywindow.document.querywindow.submit(); + top.frames.queryframe.querywindow.focus(); + } else { + top.frames.queryframe.querywindow.focus(); + } + return false; } else if (top.frames.queryframe) { new_win_url = 'querywindow.php3?sql_query=' + sql_query + '&'; diff --git a/querywindow.php3 b/querywindow.php3 index b08116e9f..b76fbc261 100644 --- a/querywindow.php3 +++ b/querywindow.php3 @@ -146,6 +146,8 @@ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) { $db = $query_history_latest_db; $table = $query_history_latest_table; $dup_sql[$query_history_latest] = true; + } elseif (isset($query_history_latest) && $query_history_latest != '') { + $sql_query = urldecode($query_history_latest); } if (isset($sql_query)) {