Bug 14640 - 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out
Summary: 'Cancel Hold' check box on check-out confirmation does not cancel the hold wh...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 20:43 UTC by Barton Chittenden
Modified: 2016-06-21 21:38 UTC (History)
6 users (show)

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


Attachments
Bug 14640 - 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out. (1.97 KB, patch)
2015-08-25 14:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14640 - 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out. (2.11 KB, patch)
2015-08-31 09:05 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 14640: Add tests (4.11 KB, patch)
2015-09-01 10:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14640 - 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out. (2.18 KB, patch)
2015-09-01 10:13 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2015-08-03 20:43:30 UTC
1) place biblio level hold on a book to borrower A. 

3) check out an item of the book to borrower B.

4) When confirming checkout, check the 'Cancel hold' check-box, and click the "Yes, check out" button.

5) Click Show Checkouts. Note that the item has an 'On hold' link in the 'Check In' area.

Clicking the link brings you to reserve/request.pl?biblionumber=..., showing the un-cancelled hold.

This was replicated on Koha 3.19.00.038
Comment 1 Kyle M Hall 2015-08-25 14:33:01 UTC
First, I want to point out there are two different pieces of code that handle similar situations, first is where a librarian attempts to check out a book on hold and *waiting* for a different patron. When this happens, Koha will offer to cancel or revert the waiting hold. This feature works correctly.

This bug is dealing with the situation where an item is checked out to a patron that is not the next in line hold-wise for an item. In this case, Koha will warn the librarian that there are holds on the item and show the first person in line. Again, I want to stress that this is the case where the item *is not waiting* for a patron. The hold for the patron listed will just have a priority of 1.

The only situation where the "Cancel hold" checkbox will function is when the priority 1 hold is an item level hold. This is due to the fact that CancelReserve is being passed the trio of biblionumber, borrowernumber, and itemnumber rather than the singular reserve_id.

The call stack is as such:

AddIssue
MoveReserve ( here is where CancelReserve should be called using reserve_id )
CancelReserve
Comment 2 Kyle M Hall 2015-08-25 14:37:45 UTC Comment hidden (obsolete)
Comment 3 Joonas Kylmälä 2015-08-31 09:05:04 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-09-01 10:13:20 UTC
Created attachment 42142 [details] [review]
Bug 14640: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2015-09-01 10:13:28 UTC
Created attachment 42143 [details] [review]
Bug 14640 - 'Cancel Hold' check box on check-out confirmation does not cancel the hold when item is checked out.

This bug is dealing with the situation where an item is checked out to a
patron that is not the next in line hold-wise for an item. In this case,
Koha will warn the librarian that there are holds on the item and
show the first person in line. Again, I want to stress that this
is the case where the item *is not waiting* for a patron. The
hold for the patron listed will just have a priority of 1.

The only situation where the "Cancel hold" checkbox will function
is when the priority 1 hold is an item level hold. This is due to
the fact that CancelReserve is being passed the trio of
biblionumber, borrowernumber, and itemnumber rather than the
singular reserve_id.

1) place biblio level hold on a book to borrower A.
2) check out an item of the book to borrower B.
3) When confirming checkout, check the 'Cancel hold' check-box, and
   click the "Yes, check out" button.
4) Note the hold was not canceled
5) Apply this patch
6) Repeat steps 1 through 3
7) Note the hold was indeed canceled

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2015-09-16 14:09:14 UTC
Patches pushed to master.

Thanks Jonathan and Kyle!
Comment 7 Barton Chittenden 2015-09-16 16:29:54 UTC
Master is at version 3.21.00.026.
Comment 8 Chris Cormack 2015-09-22 17:59:24 UTC
Pushed to 3.20.x will be in 3.20.4
Comment 9 Chris Cormack 2015-09-22 18:01:16 UTC
Pushed to 3.20.x will be in 3.20.4
Comment 10 Liz Rea 2015-09-23 01:01:07 UTC
Pushed to 3.18.x will be in 3.18.11