From 68d686f8d04833df6e0d283d66eaf021d85cfdde 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 Content-Type: text/plain; charset=utf-8 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 --- C4/AuthoritiesMarc.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index e14c85f..9840d60 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.1.4