From fe91c099e6623e19dbafd050674d1531cc51cc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 3 Jan 2011 16:32:21 +0200 Subject: [PATCH] Bug 17913: Use replace_with instead of insert_grouped_field Original fix from a patch on bug 5572. Amended by Marcel de Rooy January 2017. Note: This does not yet resolve the field order when merging to another auth type, but is a good start. Test plan: Run t/db_dependent/Authorities/Merge.t Signed-off-by: Marcel de Rooy Signed-off-by: Josef Moravec Signed-off-by: Julian Maurice --- C4/AuthoritiesMarc.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index e14c85f167..9840d6041e 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1494,8 +1494,7 @@ sub merge { foreach my $subfield (@restore) { $field_to->add_subfields($subfield->[0] =>$subfield->[1]); } - $marcrecord->delete_field($field); - $marcrecord->insert_grouped_field($field_to); + $field->replace_with($field_to); $update=1; } }#for each tag -- 2.11.0