Bug 37150 - Can't delete single title from a list using the "Remove from list" link
Summary: Can't delete single title from a list using the "Remove from list" link
Status: RESOLVED 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: 34478
Blocks: 36557 38251
  Show dependency treegraph
 
Reported: 2024-06-21 13:16 UTC by Owen Leonard
Modified: 2025-04-18 19:16 UTC (History)
6 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:
24.11.00,24.05.05
Circulation function:


Attachments
Bug 37150: Can't delete single title from a list using the "Remove from list" link (4.29 KB, patch)
2024-06-21 14:33 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37150: Can't delete single title from a list using the "Remove from list" link (8.10 KB, patch)
2024-06-24 14:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37150: Can't delete single title from a list using the "Remove from list" link (8.15 KB, patch)
2024-06-24 16:02 UTC, Eric Garcia
Details | Diff | Splinter Review
Bug 37150: Can't delete single title from a list using the "Remove from list" link (8.21 KB, patch)
2024-06-28 13:53 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2024-06-21 13:16:08 UTC
In the OPAC's display of titles on a list, the "Remove from link" control on individual titles tries to use a GET operation which fails because of CSRF protection. We need to POST that request.
Comment 1 Owen Leonard 2024-06-21 14:33:51 UTC Comment hidden (obsolete)
Comment 2 Phil Ringnalda 2024-06-21 15:10:34 UTC
I selected the checkboxes for two of the titles on my list that I wanted to place on hold, then I noticed a third one that I had already read, which I wanted to get rid of, so I used the Remove from this list for that item, got a modal asking if I wanted to remove that one title, said I did, and it and the two I wanted to place on hold were all three removed from the list.
Comment 3 Owen Leonard 2024-06-24 14:54:50 UTC
Created attachment 168015 [details] [review]
Bug 37150: Can't delete single title from a list using the "Remove from list" link

In the OPAC display of titles on a list, the "Remove from list" control
needs to trigger a POST operation instead of GET. This patch
appends a form for handling single entry deletions, populating
the hidden input upon confirmation.

To test, apply the patch and create a list if necessary, adding multiple
titles to it.

- View the contents of your list.
- Each title on your list should have a "Remove from this list" link.
  - Click one of these. You should see a modal confirmation, "Are you
    sure you want to remove this item from the list?"
    - Confirming should delete the title form the list.
  - Check multiple checkboxes in the list of titles and click "Remove
    from list" at the top of the list.
    - You should see a modal confirmation, "Are you sure you want to
      remove these items from the list?"
      - Confirming should result in all checked titles being removed
        from the list.
  - Check one or more checkboxes and then click a single "Remove from
    list" link. After confirming, you should find that only the one
    title was removed from the list.

Sponsored-by: Athens County Public Libraries
Comment 4 Eric Garcia 2024-06-24 16:02:19 UTC
Created attachment 168022 [details] [review]
Bug 37150: Can't delete single title from a list using the "Remove from list" link

In the OPAC display of titles on a list, the "Remove from list" control
needs to trigger a POST operation instead of GET. This patch
appends a form for handling single entry deletions, populating
the hidden input upon confirmation.

To test, apply the patch and create a list if necessary, adding multiple
titles to it.

- View the contents of your list.
- Each title on your list should have a "Remove from this list" link.
  - Click one of these. You should see a modal confirmation, "Are you
    sure you want to remove this item from the list?"
    - Confirming should delete the title form the list.
  - Check multiple checkboxes in the list of titles and click "Remove
    from list" at the top of the list.
    - You should see a modal confirmation, "Are you sure you want to
      remove these items from the list?"
      - Confirming should result in all checked titles being removed
        from the list.
  - Check one or more checkboxes and then click a single "Remove from
    list" link. After confirming, you should find that only the one
    title was removed from the list.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Comment 5 Martin Renvoize (ashimema) 2024-06-28 13:53:28 UTC
Created attachment 168240 [details] [review]
Bug 37150: Can't delete single title from a list using the "Remove from list" link

In the OPAC display of titles on a list, the "Remove from list" control
needs to trigger a POST operation instead of GET. This patch
appends a form for handling single entry deletions, populating
the hidden input upon confirmation.

To test, apply the patch and create a list if necessary, adding multiple
titles to it.

- View the contents of your list.
- Each title on your list should have a "Remove from this list" link.
  - Click one of these. You should see a modal confirmation, "Are you
    sure you want to remove this item from the list?"
    - Confirming should delete the title form the list.
  - Check multiple checkboxes in the list of titles and click "Remove
    from list" at the top of the list.
    - You should see a modal confirmation, "Are you sure you want to
      remove these items from the list?"
      - Confirming should result in all checked titles being removed
        from the list.
  - Check one or more checkboxes and then click a single "Remove from
    list" link. After confirming, you should find that only the one
    title was removed from the list.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2024-06-28 13:54:04 UTC
Thanks Owen, all working well no QA failures.

Passing QA
Comment 7 Katrin Fischer 2024-07-01 16:58:47 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 8 Lucas Gass (lukeg) 2024-10-09 22:08:45 UTC
Backported to 24.05.x for upcoming 24.05.05
Comment 9 Fridolin Somers 2024-10-21 13:41:17 UTC
Depends on Bug 34478 not in 23.11.x
Comment 10 Caroline Cyr La Rose 2025-04-18 19:16:33 UTC
Internal architecture, nothing to add/edit in the manual.