From 13533b382328737bb17a89464c0431ff9cc2f7f7 Mon Sep 17 00:00:00 2001
From: Oleg Vasylenko <synapse.ova@gmail.com>
Date: Mon, 19 Dec 2016 23:44:03 +0200
Subject: [PATCH] Bug 17791 - On UNIMARC system, USMARC field 100$a gets
 overwritten Patch changes the context of Z39.50 search from local to remote
 server
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Steps to Reproduce:
1) On UNIMARC system, go to Cataloguing → New from Z39.50/SRU
2) Search USMARC server (Library of Congress, for example) for a book, that has field 100 (for example, isbn 0816310653)
3) On results list, press «MARC» to see MARC fields

Expected Results:
Name of the author in 100$a
---
 C4/Breeding.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C4/Breeding.pm b/C4/Breeding.pm
index ee14c81d7c..4d0a230373 100644
--- a/C4/Breeding.pm
+++ b/C4/Breeding.pm
@@ -271,7 +271,7 @@ sub _handle_one_result {
         $marcrecord= MARC::Record->new_from_xml( $raw, 'UTF-8',
             $servhref->{syntax} );
     } else {
-        ($marcrecord) = MarcToUTF8Record($raw, C4::Context->preference('marcflavour'), $servhref->{encoding} // "iso-5426" ); #ignores charset return values
+        ($marcrecord) = MarcToUTF8Record($raw, $servhref->{syntax}, $servhref->{encoding} // "iso-5426" ); #ignores charset return values
     }
     SetUTF8Flag($marcrecord);
     my $error;
-- 
2.11.0.windows.1