Bug 13296: (follow-up) permit grep on AUTHUNIMARC
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 10 Dec 2014 15:15:26 +0000 (16:15 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 29 Dec 2014 17:37:41 +0000 (18:37 +0100)
I would prefer not to hide this "stuff".

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit 7960efe1a1c2653cfc5d757fdc0392f8a910419b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

C4/Breeding.pm

index 62ceb41..f1456a5 100644 (file)
@@ -372,9 +372,8 @@ sub ImportBreedingAuth {
     my $batch_id = GetZ3950BatchId($filename);
     my $searchbreeding = $dbh->prepare("select import_record_id from import_auths where control_number=? and authorized_heading=?");
 
-#     $encoding = C4::Context->preference("marcflavour") unless $encoding;
-    my $marc_type = C4::Context->preference('marcflavour');
-    $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC');
+    my $marcflavour = C4::Context->preference('marcflavour');
+    my $marc_type = $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : $marcflavour;
 
     # fields used for import results
     my $imported=0;
@@ -487,8 +486,8 @@ sub Z3950SearchAuth {
     my $query;
     my $nterms=0;
 
-    my $marc_type = C4::Context->preference('marcflavour');
-    $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC');
+    my $marcflavour = C4::Context->preference('marcflavour');
+    my $marc_type = $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : $marcflavour;
 
     if ($nameany) {
         $query .= " \@attr 1=1002 \"$nameany\" "; #Any name (this includes personal, corporate, meeting/conference authors, and author names in subject headings)