From: Mike Rylander Date: Tue, 29 Oct 2013 15:37:36 +0000 (-0400) Subject: Use all subfield values to link authority records to bibs X-Git-Tag: sprint4-merge-nov22~2526 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=840fbb529ff84ea2edd7c1c3b3d0b8d0b2ead5be;p=working%2FEvergreen.git Use all subfield values to link authority records to bibs Given an Evergreen instance with two authority records loaded, one being a more specific than the other via a repeated subdivision subfield, we must make sure that we use all the bib-supplied subfield values when attempting to auto-link to the correct authority. Otherwise, the "shorter" authority record may be selected as appropriate, and data in the bib record would be lost. Signed-off-by: Mike Rylander Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/support-scripts/authority_control_fields.pl.in b/Open-ILS/src/support-scripts/authority_control_fields.pl.in index 83f7db2bb3..046589e384 100755 --- a/Open-ILS/src/support-scripts/authority_control_fields.pl.in +++ b/Open-ILS/src/support-scripts/authority_control_fields.pl.in @@ -410,14 +410,14 @@ foreach my $rec_id (@records) { my $match_tag; my @searches; foreach my $c_subfield (@c_subfields) { - my $sf = $bib_field->subfield($c_subfield); - if ($sf) { + my @sf_values = $bib_field->subfield($c_subfield); + if (@sf_values) { # Give me the first element of the list of authority controlling tags for this subfield # XXX Will we need to support more than one controlling tag per subfield? Probably. That # will suck. Oh well, leave that up to Ole to implement. $match_subfields{$c_subfield} = (keys %{$controllees{$c_tag}{$c_subfield}})[0]; $match_tag = $match_subfields{$c_subfield}; - push @searches, {term => $sf, subfield => $c_subfield}; + push @searches, map {{term => $_, subfield => $c_subfield}} @sf_values; } } # print Dumper(\%match_subfields);