From ece9fe84c917780020a0354d0824db9e1d74abda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 6 Apr 2018 18:06:20 -0300 Subject: [PATCH 1/3] Revert "Remove redundant else" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8b04a2b2a7c9ff1117b1f28fa2e014f12c272c53. Signed-off-by: Maurício Meneghini Fauth --- js/functions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/functions.js b/js/functions.js index aabf3798ae..4a335e4af2 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1111,6 +1111,8 @@ function setQuery (query) { } else if (document.sqlform) { document.sqlform.sql_query.value = query; document.sqlform.sql_query.focus(); + } else { + return; } } From 7a6b3cbba871d2a429b235c0d0bffb20c1f16823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 6 Apr 2018 18:06:53 -0300 Subject: [PATCH 2/3] Revert "Cannot read property sql_query of undefined: #14104 issue fix (#14105)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ad86eab9748176ede865e6b3b80c4fd93523d508. Signed-off-by: Maurício Meneghini Fauth --- js/functions.js | 4 +--- js/sql.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/functions.js b/js/functions.js index 4a335e4af2..16b85178e2 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1108,11 +1108,9 @@ function setQuery (query) { if (codemirror_editor) { codemirror_editor.setValue(query); codemirror_editor.focus(); - } else if (document.sqlform) { + } else { document.sqlform.sql_query.value = query; document.sqlform.sql_query.focus(); - } else { - return; } } diff --git a/js/sql.js b/js/sql.js index 11e7543c76..fc4f538b87 100644 --- a/js/sql.js +++ b/js/sql.js @@ -873,9 +873,7 @@ AJAX.registerOnload('sql.js', function () { /** * Restores SQL query after timeout login */ - if (codemirror_editor || document.sqlform) { - insertQuery('saved'); - } + insertQuery('saved'); }); /* From bec8888e7c394082756f1a163e8cdb29d5d62181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 6 Apr 2018 18:07:17 -0300 Subject: [PATCH 3/3] Revert "Merge pull request #14046 from shucon/login" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5a1ceef67d62ba36da970cb33ab8c8095d1327e9, reversing changes made to 063f3806395cdfc884626f9872f85bde8b06561e. Signed-off-by: Maurício Meneghini Fauth --- js/sql.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/js/sql.js b/js/sql.js index fc4f538b87..74aa9c22ba 100644 --- a/js/sql.js +++ b/js/sql.js @@ -41,10 +41,12 @@ function PMA_urlencode (str) { * @return void */ function PMA_autosaveSQL (query) { - if (isStorageSupported('localStorage')) { - window.localStorage.auto_saved_sql = query; - } else { - Cookies.set('auto_saved_sql', query); + if (query) { + if (isStorageSupported('localStorage')) { + window.localStorage.auto_saved_sql = query; + } else { + Cookies.set('auto_saved_sql', query); + } } } @@ -869,11 +871,6 @@ AJAX.registerOnload('sql.js', function () { * create resizable table */ $('.sqlqueryresults').trigger('makegrid').trigger('stickycolumns'); - - /** - * Restores SQL query after timeout login - */ - insertQuery('saved'); }); /*