Browse Source

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 <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 823c76cdc5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a87364d0ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
17.11.x
Jonathan Druart 6 years ago
committed by Fridolin Somers
parent
commit
b829bde860
  1. 2
      circ/returns.pl

2
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;

Loading…
Cancel
Save