From 6e0c124c9c271df11b3dd06666b5556c94e26bef Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 7 Jul 2010 15:59:03 +0200 Subject: [PATCH] error 500 when record cannot be loaded On a basket or a basket download, or csv export, if Koha cannot get a biblio, then it failed with error 500. This patch fixes that behaviour skipping the faulty record in order to present the user with the biblios which are not causing trouble. Signed-off-by: Galen Charlton --- C4/Record.pm | 2 +- opac/opac-basket.pl | 1 + opac/opac-downloadcart.pl | 1 + opac/opac-downloadshelf.pl | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Record.pm b/C4/Record.pm index 3b073987fc..8e09adf2c3 100644 --- a/C4/Record.pm +++ b/C4/Record.pm @@ -362,7 +362,7 @@ sub marcrecord2csv { # Getting the record my $record = GetMarcBiblio($biblio); - + next unless $record; # Getting the framework my $frameworkcode = GetFrameworkCode($biblio); diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 9562d2f077..c453c87d22 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -62,6 +62,7 @@ foreach my $biblionumber ( @bibs ) { my $dat = &GetBiblioData($biblionumber); my $record = &GetMarcBiblio($biblionumber); + next unless $record; my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 53d1b77fc9..ff1b58f49c 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -66,6 +66,7 @@ if ($bib_list && $format) { foreach my $biblio (@bibs) { my $record = GetMarcBiblio($biblio); + next unless $record; switch ($format) { case "iso2709" { $output .= $record->as_usmarc(); } diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 5a3fb1fa1e..d73a8e72bd 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -70,6 +70,7 @@ if ($shelfid && $format) { my $biblionumber = $biblio->{biblionumber}; my $record = GetMarcBiblio($biblionumber); + next unless $record; switch ($format) { case "iso2709" { $output .= $record->as_usmarc(); } -- 2.39.5