From 1ddb5df863c3166a20d55c8f852af7c5fd67e204 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 4 Jul 2009 06:57:37 +0200 Subject: [PATCH] Bug 3226 - Extended characters inconsistantly displayed When displayed on result page, some UNIMARC biblio records are marc8 to utf8 converted for whatever reason! It appears that iso2709 records in Zebra can't always properly by used to construct MARC::Record. This patch ask Zebra to return xml record rather than iso2709 and use it to create MARC::Record (like C4::GetMarcBiblio). Signed-off-by: Galen Charlton --- C4/Context.pm | 2 +- C4/Search.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 4dab9a98c5..7ba57fb47d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -588,7 +588,7 @@ sub _new_Zconn { my $tried=0; # first attempt my $Zconn; # connection object $server = "biblioserver" unless $server; - $syntax = "usmarc" unless $syntax; + $syntax = "xml" unless $syntax; my $host = $context->{'listen'}->{$server}->{'content'}; my $servername = $context->{"config"}->{$server}; diff --git a/C4/Search.pm b/C4/Search.pm index e0e71c2ddf..52bfc607f1 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1237,7 +1237,8 @@ sub searchResults { my $marcflavour = C4::Context->preference("marcflavour"); # loop through all of the records we've retrieved for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { - my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] ); + my $marcrecord = + MARC::Record::new_from_xml( $marcresults[$i], "utf8", $marcflavour ); my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, '' ); $oldbiblio->{subtitle} = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $marcrecord, ''); $oldbiblio->{result_number} = $i + 1; -- 2.39.5