From 359dac4781cdd47f47b3148815b274d22f1f38f4 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 26 Aug 2015 11:43:08 -0400 Subject: [PATCH] Bug 14733: Prevent a record from having holds with duplicate priorities It is possible to create holds with duplicate priorities. The reason for this is that typically the priority is calculated before placing the hold. When the hold is placed the priority is calculated. This can easily be shown by opening up two browser windows and starting to place a hold for a record in each one. You'll see that both list the same priority. If you than place the hold in each window, both holds will have the same priority! Test Plan: 1) Run unit tests pre-patch, note they fail 2) Run unit tests post-patch, note they succeed Signed-off-by: Heather Braum Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 37ad2d78679fc8487811ff9cd1679eecac30faa5) Signed-off-by: Liz Rea --- C4/Reserves.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 5c4b8de8bf..e7b1c1bf57 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -209,6 +209,8 @@ sub AddReserve { ); my $reserve_id = $sth->{mysql_insertid}; + _FixPriority({ biblionumber => $biblionumber}); + # Send e-mail to librarian if syspref is active if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){ my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber); -- 2.39.5