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: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 34478
Blocks: 36557
  Show dependency treegraph
 
Reported: 2024-06-21 13:16 UTC by Owen Leonard
Modified: 2024-06-24 16:04 UTC (History)
2 users (show)

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


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

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>