Bug 13368 - Checking out an item not on loan, but with a hold, busts the holds priority
Summary: Checking out an item not on loan, but with a hold, busts the holds priority
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-02 01:15 UTC by Chris Cormack
Modified: 2016-06-21 21:36 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13368 Holds priority messed up on checkout (1.06 KB, patch)
2014-12-02 01:18 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 13368 Holds priority messed up on checkout (1.25 KB, patch)
2014-12-02 14:28 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 13368 Holds priority messed up on checkout (1.26 KB, patch)
2014-12-05 15:06 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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