From 93eba51b1936d2dbf0bf6ab35f8fad178b97c984 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 10 Nov 2015 15:05:31 -0500 Subject: [PATCH] Fix copy deletion in NCIP::ILS::Evergreen->checkinitem. We need to retrieve the copy again after a successful checkin because its status and other details have changed. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index d9929e9..cd28ead 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -449,6 +449,12 @@ sub checkinitem { $result = $result->[0]; } if ($result->{textcode} eq 'SUCCESS') { + # We need to retrieve the copy again because its status may + # have changed, and it could have been in a state that won't + # let us delete it before the checkin. + $details = $self->retrieve_copy_details_by_barcode($copy->barcode()); + $copy = $details->{copy}; + # Delete the copy. Since delete_copy checks ownership # before attempting to delete the copy, we don't bother # checking who owns it. -- 2.43.2