This problem happens when editing autorities with syspref "dontmerge" enabled. Subfield deletion is not reflected in the referencing record. How to reproduce: 0) Set the "dontmerge" syspref to "Do" 1) Create an authority record. 2) Set values in the 245$a and 245$v subfields. 3) Edit or create a biliographic record and link the authority. 4) Edit the linked authority: remove the 245$v subfield add a value in the 245$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) (subfields and $v and $z were arbitrarely chosen) A patch will follow.
(In reply to Maxime Beaulieu from comment #0) > 2) Set values in the 245$a and 245$v subfields. Woops, field tag depends of the authority you create. Ex: 150 for TOPIC_TERM
Created attachment 41112 [details] [review] 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
I can reproduce the issue you describe, and I confirm that your patch solves it. But a) your code leaves a variable ($exclude) which isn't used anymore, and b) you remove a portion of code which was introduced by bug 5264 (see also bug 5572). Have you tried solving your issue with bug 5572?
> Have you tried solving your issue with bug 5572? I have. It make it. You should use it, sign, and obsolete your patch.
I am closing this report in favor of the bugs under omnibus bug 17908. This subject is touched in many reports and we have a lot of duplicated code. The solution under 5572/11315/11700 are more comprehensive and make this behavior pref controlled. *** This bug has been marked as a duplicate of bug 17908 ***