Bug 3226 - Extended characters inconsistantly displayed
authorFrédéric Demians <f.demians@tamil.fr>
Wed, 15 Jul 2009 06:35:08 +0000 (08:35 +0200)
committerGalen Charlton <galen.charlton@liblime.com>
Wed, 15 Jul 2009 13:22:02 +0000 (09:22 -0400)
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). i

Fix facet display.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Context.pm
C4/Search.pm

index 4dab9a9..7ba57fb 100644 (file)
@@ -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};
index 456204a..4b113c1 100644 (file)
@@ -467,7 +467,7 @@ sub getRecords {
                         $results_hash->{'RECORDS'}[$j] = $record;
 
             # Fill the facets while we're looping, but only for the biblioserver
-                        $facet_record = MARC::Record->new_from_usmarc($record)
+                        $facet_record = MARC::Record->new_from_xml($record)
                           if $servers[ $i - 1 ] =~ /biblioserver/;
 
                     #warn $servers[$i-1]."\n".$record; #.$facet_record->title();
@@ -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;