Bug 2047: another fix for error during search when there is no MARC::Record
authorAndrew Moore <andrew.moore@liblime.com>
Fri, 9 May 2008 17:28:56 +0000 (12:28 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 11 May 2008 11:48:42 +0000 (06:48 -0500)
This is another fix for a bug that was introduced while adding this feature.
I believe that either this patch or the one at:
http://lists.koha.org/pipermail/koha-patches/2008-May/000309.html
should be applied.

In the case that GetMarcBiblio or GetMarcStructure does not return a true value,
this returns without further processing.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Biblio.pm

index 08c17c3..b679141 100755 (executable)
@@ -3103,8 +3103,10 @@ sub get_biblio_authorised_values {
 
     my $authorised_values;
 
-    my $record  = GetMarcBiblio( $biblionumber );
-    my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode );
+    my $record  = GetMarcBiblio( $biblionumber )
+      or return $authorised_values;
+    my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode )
+      or return $authorised_values;
 
     # assume that these entries in the authorised_value table are bibliolevel.
     # ones that start with 'item%' are item level.