To reproduce:
1. Browse a table.
2. Click "[Edit]" by the query at the top.
3. Click "Sql History"
4. Click the edit icon next to a query.
5. Click "Go" to run the query.
A Javascript error report pops up. I tried sending it but it failed. Here's the text from it:
{
"exception": {
"mode": "onerror",
"message": "Uncaught TypeError: Cannot read property 'sql_query' of undefined",
"stack": [
{
"line": 377,
"func": "checkSqlQuery",
"context": [
" *",
" * @see confirmQuery()",
" */",
"function checkSqlQuery(theForm)",
"{",
" var sqlQuery = theForm.elements['sql_query'];",
" var isEmpty = 1;",
" var space_re = new RegExp('\\\\s+');",
" if (typeof(theForm.elements['sql_file']) != 'undefined' &&",
" theForm.elements['sql_file'].value.replace(space_re, '') !== '') {",
" return true;"
],
"filename": "functions.js"
}
],
"useragent": "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
"uri": "querywindow.php?target="
},
"script_name": "querywindow.php",
"pma_version": "4.1.4",
"browser_name": "CHROME",
"browser_version": "31.0.1650.63",
"user_os": "Linux",
"server_software": "Apache/2.4.6 (Ubuntu)",
"user_agent_string": "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
"locale": "en",
"configuration_storage": "enabled",
"php_version": "5.5.3-1ubuntu2.1",
"microhistory": {
"pages": [
{
"hash": "querywindow.php?db=test&table=data&server=1&target=&token=58e0b2723c9dbbd6477c6dea3347bbe3",
"params": {
"opendb_url": "db_structure.php",
"safari_browser": "0",
"querywindow_height": "400",
"querywindow_width": "600",
"collation_connection": "utf8mb4_general_ci",
"lang": "en",
"server": "1",
"text_dir": "ltr",
"pma_text_default_tab": "Browse",
"pma_text_left_default_tab": "Structure",
"confirm": "true"
}
}
],
"current_index": "1"
}
}
Another issue in the SQL History tab: when you click the query link, it opens in a new tab instead of the tab that you opened the window from.
Come to think of it, is there really any need for a popup window? They are generally not used on the web nowadays, surely you can use the same jQuery UI modal-like window that's used for other editing? Or even just a basic dropdown menu div for the SQL History, since "Import files" and "SQL" are already available in the app using the top tabs.
I fixed only the error
please check https://github.com/phpmyadmin/phpmyadmin/pull/856
Pull request merged.
great