Bug 13368

Summary: Checking out an item not on loan, but with a hold, busts the holds priority
Product: Koha Reporter: Chris Cormack <chris>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 13368 Holds priority messed up on checkout
[SIGNED-OFF] Bug 13368 Holds priority messed up on checkout
[PASSED QA] Bug 13368 Holds priority messed up on checkout

Description Chris Cormack 2014-12-02 01:15:52 UTC
If you place 3 holds on an item that is not on loan. Then check that item out to the person who is second in the queue, the holds are not reordered.
They will be 1 and 3.

This is because ModReserveFill deletes the hold from the reserves table, after putting it in the oldreserves table. 
It then passes the reserve id to _FixPriority.
_FixPriority then queries the reserves table, and suprise suprise can't find the hold, and nothing is reordered.
Comment 1 Chris Cormack 2014-12-02 01:18:57 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-12-02 14:28:30 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2014-12-05 15:06:19 UTC
Created attachment 34148 [details] [review]
[PASSED QA] Bug 13368 Holds priority messed up on checkout

To Test

1/ Create 3 (or more holds) on one biblionumber, make sure at least
one item is not on loan
2/ Check out the not on loan item to a borrower (maybe number 2 in the
queue)
3/ Look in the database (or on the holds tab on the moredetail.pl)
notice the priorities have not been reordered
4/ Apply patch and try again, notice now they have

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Confirmed the problem without the patch, and confirmed that the patch
corrects it.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2014-12-17 23:11:23 UTC
Patch pushed to master.

Thanks Chris!
Comment 5 Chris Cormack 2014-12-18 01:22:13 UTC
Pushed to 3.18.x will be in 3.18.2