From eff33940af05e0b27f5df9c52d3613fab47d54c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Delaune?= <stephane.delaune@biblibre.com>
Date: Wed, 23 Feb 2011 12:09:40 +0100
Subject: [PATCH] Bug 6135: insert fields ordered in C4::biblio:ModBiblioMarc

Fixing order subfields for biblionumber and biblioitemnumber

BibLibre MT5951
---
 C4/Biblio.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 135dd91..a361b98 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -2924,7 +2924,7 @@ sub _koha_marc_update_bib_ids {
         # drop old field and create new one...
         $old_field = $record->field($biblio_tag);
         $record->delete_field($old_field) if $old_field;
-        $record->append_fields($new_field);
+        $record->insert_fields_ordered($new_field);
 
         # deal with biblioitemnumber
         if ( $biblioitem_tag < 10 ) {
@@ -3340,7 +3340,7 @@ sub ModBiblioMarc {
         }
         substr( $string, 22, 6, "frey50" );
         unless ( $record->subfield( 100, "a" ) ) {
-            $record->insert_grouped_field( MARC::Field->new( 100, "", "", "a" => $string ) );
+            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
         }
     }
 
-- 
1.7.4.1