From b829bde8601b1d5651dc5d4425350a96944ce7a9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Aug 2018 17:02:38 -0300 Subject: [PATCH] Bug 21168: Handle deleted checked-in items on checking in circ/returns.pl generates a server error when attempting to checkin an item while the list of previously-returned items contains an item that has been deleted. Error text: Can't call method "biblio" on an undefined value at /usr/share/koha/intranet/cgi-bin/circ/returns.pl line 606. Test plan: - checkout two items - checkin item1 - on a separate tab, delete item1 - on the original tab (which still shows item1 in the list of Checked-In Items), attempt to check in item2 => No error appears Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 823c76cdc58b7b80b365a4f313fed3462f0df720) Signed-off-by: Martin Renvoize (cherry picked from commit a87364d0ffbf906a4888f5d6d66e1a74cf280f58) Signed-off-by: Fridolin Somers --- circ/returns.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circ/returns.pl b/circ/returns.pl index c8fd468d04..303220b2c5 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -603,6 +603,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { } my $item = Koha::Items->find({ barcode => $bar_code }); + next unless $item; # FIXME The item has been deleted in the meantime, + # we could handle that better displaying a message in the template my $biblio = $item->biblio; # FIXME pass $item to the template and we are done here... $ri{itembiblionumber} = $biblio->biblionumber; -- 2.39.5