Bug fix : use delete_field/insert_grouped_field rather than replace_with
authorHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Sat, 9 Aug 2008 15:53:14 +0000 (10:53 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 9 Aug 2008 16:05:55 +0000 (11:05 -0500)
replace_with maight have unexpected behaviour.
Has to test merge_authority.pl

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/AuthoritiesMarc.pm

index 011bcf1..427fdb6 100644 (file)
@@ -1226,7 +1226,8 @@ sub merge {
                     foreach my $subfield (@record_to) {
                         $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
                     }
-                    $field->replace_with($field_to);            
+                    $marcrecord->delete_field($field);
+                    $marcrecord->insert_grouped_field($field_to);            
                     $update=1;
                 }
             }#for each tag