Bug 17913: Use AuthorityMergeMode pref in sub merge
Original fix from a patch on bug 11315. Amended by Marcel de Rooy January 2017. Test plan: If you set mode to loose, the test will still pass. If you set mode to strict, one test will fail. (Fixed later.) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
ffe1f6555c
commit
79c81920ab
|
|
@ -1473,6 +1473,7 @@ sub merge {
|
|||
}
|
||||
# BulkEdit marc records
|
||||
# May be used as a template for a bulkedit field
|
||||
my $overwrite = C4::Context->preference( 'AuthorityMergeMode' ) eq 'strict';
|
||||
foreach my $marcrecord(@reccache){
|
||||
my $update = 0;
|
||||
foreach my $tagfield (@tags_using_authtype){
|
||||
|
|
@ -1490,7 +1491,7 @@ sub merge {
|
|||
}
|
||||
$exclude='['.$exclude.']';
|
||||
# add subfields in $field not included in @record_to
|
||||
my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
|
||||
my @restore= $overwrite ? () : grep {$_->[0]!~/$exclude/} $field->subfields();
|
||||
foreach my $subfield (@restore) {
|
||||
$field_to->add_subfields($subfield->[0] =>$subfield->[1]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue