Summary: | Label batches and label templates cannot be deleted | ||
---|---|---|---|
Product: | Koha | Reporter: | Isabel Pineda <isabel.pineda> |
Component: | Label/patron card printing | Assignee: | Owen Leonard <oleonard> |
Status: | RESOLVED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | major | ||
Priority: | P5 - low | CC: | david, fridolin.somers, lucas, m.de.rooy, phil |
Version: | Main | Keywords: | regression |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This fixes the manage label batches and label templates pages so that they can now be deleted. (This is related to the CSRF changes added in Koha 24.05 to improve form security.)
|
Version(s) released in: |
24.11.00,24.05.02
|
Circulation function: | |||
Bug Depends on: | 36192 | ||
Bug Blocks: | |||
Attachments: |
Bug 37187: Fix deletion of label batches and label templates
Bug 37187: Fix deletion of label batches and label templates Bug 37187: Fix deletion of label batches and label templates Bug 37187: Fix deletion of label batches and label templates |
Description
Isabel Pineda
2024-06-25 20:33:58 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. 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. Thanks Phil, I was pondering splitting yesterday - it's better. Created attachment 168156 [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. Sponsored-by: Athens County Public Libraries 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. (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! Created attachment 168179 [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 Created attachment 168182 [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> 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> Ignoring a minor inconsistency that seems to be innocent: data-action="/cgi-bin/koha/labels/label-manage.pl" data-action="label-manage.pl" Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.02 Not for 23.11.x No changes require to the manual - fixes something not working (no UI changes, so no screenshot updates required). |