Bugzilla – Attachment 182596 Details for
Bug 39680
The navigation item "Clear” in search history doesn't delete searches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39680: "Clear" menu item doesn't delete search history
Bug-39680-Clear-menu-item-doesnt-delete-search-his.patch (text/plain), 3.48 KB, created by
Owen Leonard
on 2025-05-19 11:24:35 UTC
(
hide
)
Description:
Bug 39680: "Clear" menu item doesn't delete search history
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-05-19 11:24:35 UTC
Size:
3.48 KB
patch
obsolete
>From 491747577191077d68403ed80209ee5d4eccf334 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 @@ > <p> > <a tabindex="0" role="menuitem" class="login-link" href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a> > <span class="divider-vertical"></span> >- <a class="clearsh" href="/cgi-bin/koha/opac-search-history.pl?action=delete" title="Delete your search history"><i class="fa fa-trash-can" aria-hidden="true"></i> Clear</a> >+ <a >+ class="clearsh submit-form-link" >+ href="#" >+ data-method="post" >+ data-action="/cgi-bin/koha/opac-search-history.pl" >+ data-op="cud-delete" >+ data-confirmation-msg="[% t('Are you sure you want to delete your search history?') | html %]" >+ title="Delete your search history" >+ ><i class="fa fa-trash-can" aria-hidden="true"></i> Clear</a >+ > > </p> > [% END %] > <a tabindex="0" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">Log out</a> >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?") ); >- }); > </script> > [% IF Koha.Preference( 'opacbookbag' ) == 1 %] > [% Asset.js("js/basket.js") | $raw %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39680
:
182596
|
182626
|
182719