Bug 39680 - The navigation item "Clear” in search history doesn't delete searches
Summary: The navigation item "Clear” in search history doesn't delete searches
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Owen Leonard
QA Contact: Julian Maurice
URL:
Keywords:
Depends on: 34478
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-18 14:25 UTC by Nina Martinez
Modified: 2025-05-22 13:27 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39680: "Clear" menu item doesn't delete search history (3.48 KB, patch)
2025-05-19 11:24 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39680: "Clear" menu item doesn't delete search history (3.53 KB, patch)
2025-05-19 14:57 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 39680: "Clear" menu item doesn't delete search history (3.59 KB, patch)
2025-05-22 08:15 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nina Martinez 2025-04-18 14:25:39 UTC
When you try to delete your search history using this item, it asks if you are really sure. However, even if you confirm, it does not delete your history and instead just sends you to the search history summary.

We should correct this.

If you want to check this issue:

-Connect to your account.
-Make some searches.
-Try to clear your history using the "Clear Search History" item in the user menu.
-Confirm the action 
-Check if your search history is empty or not.
Comment 1 Owen Leonard 2025-05-19 11:24:35 UTC
Created attachment 182596 [details] [review]
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
Comment 2 Roman Dolny 2025-05-19 14:57:49 UTC
Created attachment 182626 [details] [review]
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>
Comment 3 Julian Maurice 2025-05-22 08:15:10 UTC
Created attachment 182719 [details] [review]
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>
Comment 4 Katrin Fischer 2025-05-22 13:25:45 UTC
Pushed for 25.05!

Well done everyone, thank you!