From f7f4d33fd35d14aede9c55e5d4611c8ff3c2412c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Sep 2020 11:43:00 +0200 Subject: [PATCH] Bug 26562: [20.05.x] Removes 'searches' from localStorage on logout A user recently logged in will inherit the "searches" item stored in localStorage. To recreate: Log in with user A, do some searches Note that the "searches" item is filled in with the search queries Logout and log in with user B Note that the "searches" item is still there Signed-off-by: Lucas Gass Signed-off-by: Lucas Gass (cherry picked from commit 402bf0240325a9a194dd6c62f7b4e478e1505b15) Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 5 +++-- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index acdbeb327e..86db48ff66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -126,8 +126,9 @@ if ( document.location.hash ) { $( '#loginform' ).append( '' ); } - // if showLastPatron information was not cleared during logout, clear it now - removeLastBorrower(); + + // Clear last borrowers, rememberd sql reports, carts, etc. + logOut(); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index f05d09ea76..16ef051fba 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -179,6 +179,7 @@ function logOut(){ } clearHoldFor(); removeLastBorrower(); + localStorage.removeItem("searches"); } function openHelp(){ -- 2.39.5