From 491747577191077d68403ed80209ee5d4eccf334 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 --- .../opac-tmpl/bootstrap/en/includes/masthead.inc | 11 ++++++++++- .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index e31b6ac89de..42b3408901d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -170,7 +170,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 8b2fd7368a6..065c89c4710 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -136,9 +136,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 %] [% Asset.js("js/basket.js") | $raw %] -- 2.39.5