From: Jonathan Druart Date: Wed, 25 Mar 2015 08:39:02 +0000 (+0100) Subject: Bug 3873: Avoid software error if the cart contains a deleted record X-Git-Tag: v3.20.00-beta~406 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=4c4c870dfee59ebe6386dbd8a7b75a55f75217f9;p=srvgit Bug 3873: Avoid software error if the cart contains a deleted record If a record is placed in the basket and deleted, the basket view exploded with: Can't use an undefined value as an ARRAY reference at /home/koha/src/basket/basket.pl line 73. Test plan: 1/ Add some records to the basket 2/ Delete one of them 3/ Look at your basket It should not exploded Note that the number of items in the basket is now wrong. Works as expected. Signed-off-by: Marc Veron Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- diff --git a/basket/basket.pl b/basket/basket.pl index ea8e86310b..83440fd66e 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -61,6 +61,7 @@ foreach my $biblionumber ( @bibs ) { $template->param( biblionumber => $biblionumber ); my $dat = &GetBiblioData($biblionumber); + next unless $dat; my $record = &GetMarcBiblio($biblionumber); my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );