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 <hbraum@nekls.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle M Hall 2015-08-26 11:43:08 -04:00 committed by Tomas Cohen Arazi
parent e16367f0a8
commit 37ad2d7867
1 changed files with 2 additions and 0 deletions

View File

@ -193,6 +193,8 @@ sub AddReserve {
my $fee = GetReserveFee( $borrowernumber, $biblionumber );
ChargeReserveFee( $borrowernumber, $fee, $title );
_FixPriority({ biblionumber => $biblionumber});
# Send e-mail to librarian if syspref is active
if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){
my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);