New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs in SQL query restore after session expire #14094
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=""'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add inline javascript here? See #13270.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most places have inline onsubmit present in forms so maintain the same coding style I preferred inline js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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: