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 <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
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);