Bug 19537: Correct addition of source subfield from authorities
authorNick Clemens <nick@bywatersolutions.com>
Fri, 27 Oct 2017 10:43:03 +0000 (10:43 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 8 Nov 2017 16:34:48 +0000 (13:34 -0300)
To test:
1 - Find or create a subject authority
2 - Define 008/11 as 's' or 'r'
3 - Add 2nd indicator '7' to main heading
4 - Open or create a bibliographic record
5 - Link to the authority created above
6 - Subfield $2 is not set
7 - Apply patch
8 - Repeat linking, subfield $2 should be set

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

authorities/blinddetail-biblio-search.pl

index 33b7ef0..838e4ba 100755 (executable)
@@ -122,9 +122,9 @@ if ($authid) {
             $indicator2 = defined $thes_mapping{$thes_008_11} ? $thes_mapping{$thes_008_11} : $thes_008_11;
             if ($indicator2 eq '7') {
                 if ($thes_008_11 eq 'r') {
-                    $subfields{'2'} = ['aat'];
+                    push @subfield_loop, { marc_subfield => '2', marc_values => ('aat') };
                 } elsif ($thes_008_11 eq 's') {
-                    $subfields{'2'} = ['sears'];
+                    push @subfield_loop, { marc_subfield => '2', marc_values => ('sears') };
                 }
             }
         }