From abb8865d75df361de6cbbd812613d4761f837771 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 25 Feb 2020 14:42:29 +0000 Subject: [PATCH] Bug 24553: Use 'barcode' not 'item_id' when removing hold from SIP patron The drop_hold routine was using the wrong parameter for item info in the patron's array of holds. We store it as 'barcode' not 'item_id'. This is true for both waiting and unavailable holds To test: 1 - Apply unit tests patch 2 - prove -v t/db_dependent/SIP/ILS.t 3 - It fails 4 - Apply second patch 5 - prove -v t/db_dependent/SIP/ILS.t 6 - It passes! You can also see bug 24175 - you cna hack sip_cli_emulator to allow cancelling a hold and check the messages, test coverage is improved by this patch and should be sufficient for testing Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- C4/SIP/ILS/Patron.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm index 36bbe973b7..99546da569 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -286,7 +286,7 @@ sub drop_hold { foreach (qw(hold_items unavail_holds)) { $self->{$_} or next; for (my $i = 0; $i < scalar @{$self->{$_}}; $i++) { - my $held_item = $self->{$_}[$i]->{item_id} or next; + my $held_item = $self->{$_}[$i]->{barcode} or next; if ($held_item eq $item_id) { splice @{$self->{$_}}, $i, 1; $result++; -- 2.39.5