Bug 15381: Fix error in SearchAuthorities when no authtypecode
authorFrédéric Demians <f.demians@tamil.fr>
Sun, 20 Dec 2015 16:17:08 +0000 (17:17 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Thu, 31 Dec 2015 18:59:03 +0000 (18:59 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com

C4/AuthoritiesMarc.pm

index a2e01e5..43c5faf 100644 (file)
@@ -291,7 +291,9 @@ sub SearchAuthorities {
         my %newline;
         $newline{authid} = $authid;
         if ( !$skipmetadata ) {
-            my $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report;
+            my $auth_tag_to_report;
+            $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report
+                if $authtypecode;
             my $reported_tag;
             my $mainentry = $authrecord->field($auth_tag_to_report);
             if ($mainentry) {