Summary: | 'Cancel selected' on holds table does not work | ||
---|---|---|---|
Product: | Koha | Reporter: | Pedro Amorim <pedro.amorim> |
Component: | Circulation | Assignee: | Phil Ringnalda <phil> |
Status: | Pushed to main --- | QA Contact: | Pedro Amorim <pedro.amorim> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, kyle.m.hall, pedro.amorim, phil |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
25.05.00
|
|
Circulation function: | |||
Bug Depends on: | 37783 | ||
Bug Blocks: | |||
Attachments: |
Bug 38853: Make 'Cancel selected' on holds table work
Bug 38853: Make 'Cancel selected' on holds table work Bug 38853: Make 'Cancel selected' on holds table work |
Description
Pedro Amorim
2025-01-09 12:29:03 UTC
No question, it should be buggy, and I see why (koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt#L1922 means to call the function .empty() but instead throws away the value of checking the property empty). But something is missing from those steps to reproduce: when I do that, place one any-copy hold on a record with no holds and then check the one hold and cancel selected, I get a background job scheduled which does cancel the hold. Well, that was fun. Somehow my repo became convinced that origin/main was 23.11.x, so git checkout -b bug_38853 origin/main kept showing me that everything was working just fine. Created attachment 176306 [details] [review] Bug 38853: Make 'Cancel selected' on holds table work Because 'Cancel selected' on the table of existing holds uses $("#cancel_modal_form #inputs").empty; rather than empty();, it fails to clear out whatever things are in there before it puts in the things it wants. That leaves things in a confused state, and makes it fail to actually cancel holds. Test plan: 1. Without the patch, add a hold to any bib record 2. Select the checkbox for the hold you placed, then click 'Cancel selected' and confirm that you want to cancel 3. Note that there's no message box about a background job having been enqueued, and no matter how long you wait, the hold doesn't go away 4. Apply patch, repeat step 2, note that there's now a message box, and when the background job finishes, that the hold has been deleted. Sponsored-by: Chetco Community Public Library Created attachment 176327 [details] [review] Bug 38853: Make 'Cancel selected' on holds table work Because 'Cancel selected' on the table of existing holds uses $("#cancel_modal_form #inputs").empty; rather than empty();, it fails to clear out whatever things are in there before it puts in the things it wants. That leaves things in a confused state, and makes it fail to actually cancel holds. Test plan: 1. Without the patch, add a hold to any bib record 2. Select the checkbox for the hold you placed, then click 'Cancel selected' and confirm that you want to cancel 3. Note that there's no message box about a background job having been enqueued, and no matter how long you wait, the hold doesn't go away 4. Apply patch, repeat step 2, note that there's now a message box, and when the background job finishes, that the hold has been deleted. Sponsored-by: Chetco Community Public Library Signed-off-by: David Nind <david@davidnind.com> Created attachment 176330 [details] [review] Bug 38853: Make 'Cancel selected' on holds table work Because 'Cancel selected' on the table of existing holds uses $("#cancel_modal_form #inputs").empty; rather than empty();, it fails to clear out whatever things are in there before it puts in the things it wants. That leaves things in a confused state, and makes it fail to actually cancel holds. Test plan: 1. Without the patch, add a hold to any bib record 2. Select the checkbox for the hold you placed, then click 'Cancel selected' and confirm that you want to cancel 3. Note that there's no message box about a background job having been enqueued, and no matter how long you wait, the hold doesn't go away 4. Apply patch, repeat step 2, note that there's now a message box, and when the background job finishes, that the hold has been deleted. Sponsored-by: Chetco Community Public Library Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Thanks for the fix and quick reaction Phil! Pushed for 25.05! Well done everyone, thank you! |