From 5d9f21a0f1244834c1785dc276c61bd9420ecf0b 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 --- circ/returns.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circ/returns.pl b/circ/returns.pl index a82bdc1432..a726e5980d 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -551,6 +551,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.11.0