Fix bugs in SQL query restore after session expire #14094
Closed
Conversation
Fixes: #14093 Also, the sql query was getting stored in the browser indefinetly even after visiting another page and then coming back. So it had to be cleared from localstorage on page change. Signed-off-by: Saksham Gupta <shucon01@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #14094 +/- ##
============================================
+ Coverage 55.43% 55.43% +<.01%
- Complexity 14366 14374 +8
============================================
Files 494 494
Lines 70550 70612 +62
============================================
+ Hits 39106 39147 +41
- Misses 31444 31465 +21 |
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
libraries/classes/SqlQueryForm.php
Outdated
@@ -82,6 +82,7 @@ public static function getHtml( | |||
// start output | |||
$html .= '<form method="post" action="import.php" ' . $enctype; | |||
$html .= ' class="ajax lock-page"'; | |||
$html .= ' onsubmit=window.localStorage.auto_saved_sql=""'; |
shucon
Mar 27, 2018
Author
Contributor
Most places have inline onsubmit present in forms so maintain the same coding style I preferred inline js.
Most places have inline onsubmit present in forms so maintain the same coding style I preferred inline js.
shucon
Mar 27, 2018
Author
Contributor
Okay, so all the onsubmit js are inline and needs to be changed, so I'll just fix this one here.
Okay, so all the onsubmit js are inline and needs to be changed, so I'll just fix this one here.
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
The "Get auto-saved query" button has no more action after these changes. |
@mauriciofauth Get auto-saved query is not working on master branch too. I'll check it and try to fix that too. |
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
Thanks for your contribution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes: #14093
Also, the sql query was getting stored in the browser indefinetly even after visiting another page and then coming back. So it had to be cleared from localstorage on page change.
Signed-off-by: Saksham Gupta shucon01@gmail.com
Before submitting pull request, please check that every commit: