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 <roman.dolny@jezuici.pl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fa557624e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
a885752801
commit
ebf2ec8553
|
|
@ -138,7 +138,16 @@
|
|||
<p>
|
||||
<a tabindex="-1" 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="-1" role="menuitem" class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">Log out</a>
|
||||
|
|
|
|||
|
|
@ -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?") );
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
[% IF Koha.Preference( 'opacbookbag' ) == 1 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue