error 500 when record cannot be loaded
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 7 Jul 2010 13:59:03 +0000 (15:59 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 7 Jul 2010 16:38:26 +0000 (12:38 -0400)
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 <gmcharlt@gmail.com>
C4/Record.pm
opac/opac-basket.pl
opac/opac-downloadcart.pl
opac/opac-downloadshelf.pl

index 3b07398..8e09adf 100644 (file)
@@ -362,7 +362,7 @@ sub marcrecord2csv {
 
     # Getting the record
     my $record = GetMarcBiblio($biblio);
-
+    next unless $record;
     # Getting the framework
     my $frameworkcode = GetFrameworkCode($biblio);
 
index 9562d2f..c453c87 100755 (executable)
@@ -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 );
index 53d1b77..ff1b58f 100755 (executable)
@@ -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(); }
index 5a3fb1f..d73a8e7 100755 (executable)
@@ -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(); }