[Koha-cvs] koha/C4 Biblio.pm [rel_3_0]

Henri-Damien LAURENT laurenthdl at alinto.com
Tue Sep 26 09:54:20 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Henri-Damien LAURENT <hdl>	06/09/26 07:54:20

Modified files:
	C4             : Biblio.pm 

Log message:
	Bug FIX: Correct accents for UNIMARC biblio MARC details.
	(Adding the use of default_record_format in MARCgetbiblio if UNIMARC marcflavour is chosen. This should be widely used as soon as we use xml records)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.178.2.8&r2=1.178.2.9

Patches:
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.178.2.8
retrieving revision 1.178.2.9
diff -u -b -r1.178.2.8 -r1.178.2.9
--- Biblio.pm	25 Sep 2006 14:46:22 -0000	1.178.2.8
+++ Biblio.pm	26 Sep 2006 07:54:20 -0000	1.178.2.9
@@ -23,7 +23,7 @@
 use C4::Database;
 use MARC::Record;
 use MARC::File::USMARC;
-use MARC::File::XML;
+use MARC::File::XML(BinaryEncoding=>"utf8");
 use ZOOM;
 use Data::Dumper;
 use C4::Koha;
@@ -386,11 +386,12 @@
 sub MARCgetbiblio {
 	my ( $dbh, $bibid ) = @_;
 	my $dbh = C4::Context->dbh;
-	my $sth = $dbh->prepare("select marc from biblioitems where biblionumber=? "  );
+	my $sth = $dbh->prepare("select marcxml from biblioitems where biblionumber=? "  );
     $sth->execute($bibid);
-    my ($marc)=$sth->fetchrow;
+    my ($marcxml)=$sth->fetchrow;
     my $record = MARC::Record->new();
-    $record = MARC::Record::new_from_usmarc( $marc ) if $marc;
+    MARC::File::XML::default_record_format("UNIMARC") if (C4::Context->preference("marcflavour") eq "UNIMARC");
+    $record = MARC::Record::new_from_xml( $marcxml,"utf8" ) if $marcxml;
 	return $record;
 }
 ############OLD VERSION HERE###############################################
@@ -3218,8 +3219,12 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.178.2.8 2006/09/25 14:46:22 hdl Exp $
+# $Id: Biblio.pm,v 1.178.2.9 2006/09/26 07:54:20 hdl Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.178.2.9  2006/09/26 07:54:20  hdl
+# Bug FIX: Correct accents for UNIMARC biblio MARC details.
+# (Adding the use of default_record_format in MARCgetbiblio if UNIMARC marcflavour is chosen. This should be widely used as soon as we use xml records)
+#
 # Revision 1.178.2.8  2006/09/25 14:46:22  hdl
 # Now using iso2709 MARC data for MARC.
 # (Works better for accents than XML)





More information about the Koha-cvs mailing list