From 1deaecb6d821f2b8f2e3e3aca2e77f3e28d7aefb Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 4 Nov 2009 21:15:55 +0000 Subject: [PATCH] (Bug 3767 - Return error if checkin passed an invalid item If an invalid item barcode is passed to checkin the sip2 connection dies. This is because although no item object is created its mehods are called in Checkin To maintain the connection properly catch the condition and return the correct response to the unit (should also fix Bug #3696 ) Signed-off-by: Galen Charlton --- C4/SIP/ILS.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index f57bbd06f4..9e2084594e 100644 --- a/C4/SIP/ILS.pm +++ b/C4/SIP/ILS.pm @@ -180,7 +180,13 @@ sub checkin { # BEGIN TRANSACTION $circ->item($item = new ILS::Item $item_id); - $circ->do_checkin($current_loc, $return_date); + if ($item) { + $circ->do_checkin($current_loc, $return_date); + } else { + $circ->alert(1); + $circ->alert_type(99); + $circ->screen_msg('Invalid Item'); + } # It's ok to check it in if it exists, and if it was checked out $circ->ok($item && $item->{patron}); -- 2.39.2