@@ -, +, @@ in SimpleMARC - create a marc modification template which add a new field to a record - apply that template to some records - verify that the new field is always appended at the bottom of the record, even if some fields are higher. - apply patch - apply template to another set of records - verify the added field is now ordered within the already existing fields in the records --- Koha/SimpleMARC.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/Koha/SimpleMARC.pm +++ a/Koha/SimpleMARC.pm @@ -202,12 +202,12 @@ sub add_field { if ( $fieldName > 10 ) { foreach my $value ( @values ) { my $field = MARC::Field->new( $fieldName, '', '', "$subfieldName" => $value ); - $record->append_fields( $field ); + $record->insert_fields_ordered( $field ); } } else { foreach my $value ( @values ) { my $field = MARC::Field->new( $fieldName, $value ); - $record->append_fields( $field ); + $record->insert_fields_ordered( $field ); } } } --