Bug 22881 - Trying to clear search history via the navbar X doesn't clear any searches
Summary: Trying to clear search history via the navbar X doesn't clear any searches
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 21479
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-09 21:49 UTC by Margaret Hade
Modified: 2020-06-04 20:32 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.06
Circulation function:


Attachments
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches (1.64 KB, patch)
2019-05-10 13:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches (1.72 KB, patch)
2019-05-10 14:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches (1.78 KB, patch)
2019-05-11 09:15 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Margaret Hade 2019-05-09 21:49:35 UTC
To Reproduce: 
1) Run a few keyword searches on your Opac. You can be logged in or not, the behavior is the same.
2) Go to 'My Search History' the /cgi-bin/koha/opac-search-history.pl page.
3) Delete your past searches by selecting one or multiple searches and clicking the "Remove Selected Searches" button. You'll get an alert pop-up about what you are about to delete. The searches you selected should delete successfully.
4) Look at the little "x" (next to "Search History" in the Navbar). If you click on this "x" it will give you the exact same alert pop-up, however is you say yes, delete my searches, nothing will be deleted. 

Either the little "x" should not give you the option to delete searches nor the alert message or it should clear all your saved searches; as if you hit select all and Remove. Otherwise patrons who want to delete their history will be incorrectly lead to believe it was cleared if they don't check /cgi-bin/koha/opac-search-history.pl .
Comment 1 Owen Leonard 2019-05-10 13:38:35 UTC
Created attachment 89548 [details] [review]
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches

This patch undoes a mistake introduced in my patch for Bug 21479. A
"preventDefault()" was added to the search history clear button by
mistake. The "confirmDelete" function only works if the default action
of the link is allowed to complete.

To test you must have the EnableOpacSearchHistory system preference
enabled. Apply the patch and log into the OPAC as a patron who has a
search history.

Click the "X" link in the header next to the "Search history" link.
Confirm that you want to clear your search history. The page should
refresh. Navigate to your account -> Your search history to confirm that
your search history has been cleared.
Comment 2 Jonathan Druart 2019-05-10 14:14:15 UTC
Created attachment 89549 [details] [review]
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches

This patch undoes a mistake introduced in my patch for Bug 21479. A
"preventDefault()" was added to the search history clear button by
mistake. The "confirmDelete" function only works if the default action
of the link is allowed to complete.

To test you must have the EnableOpacSearchHistory system preference
enabled. Apply the patch and log into the OPAC as a patron who has a
search history.

Click the "X" link in the header next to the "Search history" link.
Confirm that you want to clear your search history. The page should
refresh. Navigate to your account -> Your search history to confirm that
your search history has been cleared.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Katrin Fischer 2019-05-11 09:15:43 UTC
Created attachment 89579 [details] [review]
Bug 22881: Trying to clear search history via the navbar X doesn't clear any searches

This patch undoes a mistake introduced in my patch for Bug 21479. A
"preventDefault()" was added to the search history clear button by
mistake. The "confirmDelete" function only works if the default action
of the link is allowed to complete.

To test you must have the EnableOpacSearchHistory system preference
enabled. Apply the patch and log into the OPAC as a patron who has a
search history.

Click the "X" link in the header next to the "Search history" link.
Confirm that you want to clear your search history. The page should
refresh. Navigate to your account -> Your search history to confirm that
your search history has been cleared.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Nick Clemens (kidclamp) 2019-05-14 18:22:27 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize (ashimema) 2019-05-24 13:43:33 UTC
Pushed to 18.11.x for 18.11.06
Comment 6 Lucas Gass (lukeg) 2019-05-30 15:34:43 UTC
backported to 18.05.x for 18.05.13