From 6255dd3c52103d82f5d9199998651a173d9afc50 Mon Sep 17 00:00:00 2001 From: mxbeaulieu Date: Tue, 21 Jul 2015 14:14:50 -0400 Subject: [PATCH] Bug 14583 - Subfields not deleted when automatically merging authorities This problem happens when editing autorities with syspref "dontmerge" enabled. Subfield deletion is not reflected in the referencing record. How to test: 0) Set the "dontmerge" syspref to "Do" 1) Create a Topical Term authority record. 2) Set values in the 150$a and 150$v subfields. 3) Edit or create a biliographic record and link the authority. 4) Edit the linked authority: remove the 150$v subfield add a value in the 150$z sufield 5) Check the authority values in the bibliographic record: The $v subfield is still there (merge failed) The $z subfield was added (merge worked) 6) Apply the patch 7) Edit the linked authority: remove the 150$z subfield add a value in the 150$x sufield 8) Check the authority values in the bibliographic record: The deleted subfields are gone. modified: C4/AuthoritiesMarc.pm --- C4/AuthoritiesMarc.pm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f617437..bb390eb 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1530,11 +1530,6 @@ sub merge { $exclude.= $subfield->[0]; } $exclude='['.$exclude.']'; -# add subfields in $field not included in @record_to - my @restore= grep {$_->[0]!~/$exclude/} $field->subfields(); - foreach my $subfield (@restore) { - $field_to->add_subfields($subfield->[0] =>$subfield->[1]); - } $marcrecord->delete_field($field); $marcrecord->insert_grouped_field($field_to); $update=1; -- 1.7.9.5