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 .
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.
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>
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>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.06
backported to 18.05.x for 18.05.13