bugfix: do not crash when searching 'default' (all) heading types
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 12 Nov 2007 23:13:47 +0000 (17:13 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 13 Nov 2007 00:32:44 +0000 (18:32 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/AuthoritiesMarc.pm

index 92c7faf..d0af4e6 100644 (file)
@@ -653,7 +653,8 @@ sub GetAuthType {
     my ($authtypecode) = @_;
     my $dbh=C4::Context->dbh;
     my $sth;
-    if ($authtypecode){
+    if (defined $authtypecode){ # NOTE - in MARC21 framework, '' is a valid authority 
+                                # type
       $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
       $sth->execute($authtypecode);
     } else {
@@ -917,7 +918,7 @@ sub BuildSummary{
           foreach my $field ($record->field('5..')) {
               $altheading.= "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> ".$field->as_string();
           }
-          $summary .= ": ";
+          $summary .= ": " if $summary;
           $summary.=$heading.$seeheading.$altheading;
       }
   }