From 43f15f13123c705bb750af43a74997e581b48719 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 26 Sep 2019 09:09:15 +0200 Subject: [PATCH] Bug 23679: fix software error when trying to transfer an unknown barcode When trying to transfer an unknown barcode in /cgi-bin/koha/circ/branchtransfers.pl you get the error : Can't call method "itemnumber" on an undefined value at /home/koha/src/C4/Circulation.pm line 319. This comes from C4::Circulation::transferbook which should stop when finding unknown barcode. Test plan : 1) Go to /cgi-bin/koha/circ/branchtransfers.pl 2) Enter a barcode not existing in database 3) Without patch you get a software error, with patch you get a message saying 'No Item with barcode' 4) Enter a barcode existing in database and check transfer is OK Signed-off-by: Owen Leonard Signed-off-by: Bin Wen Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit 3848a3a772e2202ac3339bd241adcef987e48361) Signed-off-by: Fridolin Somers --- C4/Circulation.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a0c40d5fdd..e1cf7bf07b 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -315,6 +315,7 @@ sub transferbook { unless ( $item ) { $messages->{'BadBarcode'} = $barcode; $dotransfer = 0; + return ( $dotransfer, $messages ); } my $itemnumber = $item->itemnumber; -- 2.39.5