From 6318e88eb3edbb7ea2e62b5c426bdb89ba656ccc Mon Sep 17 00:00:00 2001
From: BibLibre <dev_patches@biblibre.com>
Date: Thu, 9 Feb 2012 10:11:36 +0100
Subject: [PATCH] Bug 7513 Marc Import Hangs

On some record, the commit_biblio_file is creating wide
character
because as_xml is not used with correct parameter.
This patch fixes that.
To test on a UNIMARC Koha, stage attachment 7510 and
then import.
It hangs before the patch, it passes after.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
---
 C4/ImportBatch.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm
index b6db406..63cc60b 100644
--- a/C4/ImportBatch.pm
+++ b/C4/ImportBatch.pm
@@ -1150,7 +1150,7 @@ sub _update_import_record_marc {
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("UPDATE import_records SET marc = ?, marcxml = ?
                              WHERE  import_record_id = ?");
-    $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml(), $import_record_id);
+    $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml(C4::Context->preference('marcflavour')), $import_record_id);
     $sth->finish();
 }
 
-- 
1.7.5.4