From ebf2ec8553a6391cde49911dbff2655c801b91c0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 19 May 2025 11:16:43 +0000 Subject: [PATCH] Bug 39680: "Clear" menu item doesn't delete search history This patch fixes the behavior of the OPAC's "Clear" link, which was not updated to work with CSRF protection. To test: - If necessary, go to Administration -> System preferences in the staff interface and set the EnableOpacSearchHistory preference to "Keep." - Log in to the OPAC. - If necessary, perform several catalog searches in order to populate your search history. - Expand the user menu in the upper right-hand corner and click the "Clear" link next to "Search history." - You should be prompted to confirm. - After confirming your search history should be empty. Sponsored-by: Athens County Public Libraries Signed-off-by: Roman Dolny Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer (cherry picked from commit fa557624e98d4beaed2cff1ea019edaa8b1be27a) Signed-off-by: Fridolin Somers --- .../opac-tmpl/bootstrap/en/includes/masthead.inc | 11 ++++++++++- .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 4 ---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 70713da7f0..d30a47a75a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -138,7 +138,16 @@

- Clear + Clear

[% END %] Log out diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index b2b83e3efb..21b7c1c569 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -119,10 +119,6 @@ var biblionumber = $(this).data("biblionumber"); delSingleRecord( biblionumber ); }); - $(".clearsh").on("click", function(){ - return confirmDelete( _("Are you sure you want to delete your search history?") ); - }); - [% IF Koha.Preference( 'opacbookbag' ) == 1 %]