Bug 37187 - Label batches cannot be deleted
Summary: Label batches cannot be deleted
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords: regression
Depends on: 36192
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-25 20:33 UTC by Isabel Pineda
Modified: 2024-06-28 11:50 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:
24.11.00


Attachments
Bug 37187: Fix deletion of label batches and label templates (2.88 KB, patch)
2024-06-26 15:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37187: Fix deletion of label batches and label templates (6.08 KB, patch)
2024-06-26 19:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37187: Fix deletion of label batches and label templates (6.13 KB, patch)
2024-06-26 21:14 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 37187: Fix deletion of label batches and label templates (6.23 KB, patch)
2024-06-28 07:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Isabel Pineda 2024-06-25 20:33:58 UTC
After updating from version 23.11 to 24.05, I found 2 problems with label batches:

1. In the item view of a book, the option "Actions > Print label" is not working anymore. I have to go to the Cataloging module to create a new label batch from there.

2. I cannot delete label batches anymore: The "Delete"-button in the list of label batches is not working. And inside the label batch, the button "Delete label batch" is not working either.
Comment 1 Phil Ringnalda 2024-06-26 02:43:23 UTC
I split number 1 off to bug 37192 because even though they are caused by the same thing (the giant CSRF protection bug), fixing them is going to be different sorts of fixes in widely separated places.

The problem with deleting batches is that the script expects the op cud-delete, correctly, and so the request has to be POSTed, but both places in the UI that delete batches just do a GET with ?op=delete.
Comment 2 Phil Ringnalda 2024-06-26 03:19:21 UTC
Not a workaround I'd be happy with, but while testing a patch for bug 37192 I noticed that if you delete all the items in a batch (easy enough if there's only one) and then just walk away, the empty batch is automatically deleted.
Comment 3 Katrin Fischer 2024-06-26 07:15:32 UTC
Thanks Phil, I was pondering splitting yesterday - it's better.
Comment 4 Owen Leonard 2024-06-26 15:03:41 UTC Comment hidden (obsolete)
Comment 5 Phil Ringnalda 2024-06-26 17:31:50 UTC
Because labels seem to always have at least two ways to do the same thing, that fixes the delete button in the list of batches, but not the delete button in label-edit-batch.pl that you use (when you remember to use it) in the workflow "add items to batch, export batch to actually print, delete batch" all in the editor.
Comment 6 Owen Leonard 2024-06-26 19:15:12 UTC
(In reply to Phil Ringnalda from comment #5)
> not the delete button in label-edit-batch.pl

Quite right, I didn't read the report carefully!
Comment 7 Owen Leonard 2024-06-26 19:49:42 UTC Comment hidden (obsolete)
Comment 8 ByWater Sandboxes 2024-06-26 21:14:43 UTC Comment hidden (obsolete)
Comment 9 Marcel de Rooy 2024-06-28 07:46:05 UTC
Created attachment 168226 [details] [review]
Bug 37187: Fix deletion of label batches and label templates

This patch uses the new form-submit JS to convert the label management
deletion link from a GET operation to POST.

To test, apply the patch and go to Cataloging -> Label creator.

- Click Manage -> Label batches. Create a batch if necessary.
- Click the "Delete" button in the "Actions" column. You should get a
  confirmation message, "Are you sure you want to delete this?"
  - Test both the confirming and cancelling.
- Perform the same test with Manage -> Label templates.
- From the Manage -> Label batches page, click "edit" on one of the
  batches.
- Right above the "Items in batch number X" is a toolbar which should
  have a button, "Delete batch." Test that it works correctly to delete
  the batch.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2024-06-28 07:46:45 UTC
Ignoring a minor inconsistency that seems to be innocent:
data-action="/cgi-bin/koha/labels/label-manage.pl"
data-action="label-manage.pl"
Comment 11 Katrin Fischer 2024-06-28 11:50:34 UTC
Pushed for 24.11!

Well done everyone, thank you!