[Koha-cvs] koha/acqui.simple addbiblio.pl [rel_2_2]

Joshua Ferraro jmf at kados.org
Tue Mar 21 15:47:12 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Joshua Ferraro <kados at savannah.gnu.org>	06/03/21 14:47:12

Modified files:
	acqui.simple   : addbiblio.pl 

Log message:
	fixes a bug where if the record contained wide chars already it would
	throw a 500 error.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/acqui.simple/addbiblio.pl.diff?only_with_tag=rel_2_2&tr1=1.52.2.33&tr2=1.52.2.34&r1=text&r2=text

Patches:
Index: koha/acqui.simple/addbiblio.pl
diff -u koha/acqui.simple/addbiblio.pl:1.52.2.33 koha/acqui.simple/addbiblio.pl:1.52.2.34
--- koha/acqui.simple/addbiblio.pl:1.52.2.33	Sat Mar 18 13:20:21 2006
+++ koha/acqui.simple/addbiblio.pl	Tue Mar 21 14:47:12 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: addbiblio.pl,v 1.52.2.33 2006/03/18 13:20:21 kados Exp $
+# $Id: addbiblio.pl,v 1.52.2.34 2006/03/21 14:47:12 kados Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -538,8 +538,12 @@
 	}
 	unless ($record == -1) {
 	#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
-        my $uxml = $record->as_xml;
-        $record = MARC::Record::new_from_xml($uxml, 'UTF-8'); 
+	eval {
+        	my $uxml = $record->as_xml;
+		my $newrecord = MARC::Record::new_from_xml($uxml, 'UTF-8');
+		$record = $newrecord;
+	};
+
 	}
 	build_tabs ($template, $record, $dbh,$encoding);
 	build_hidden_data;





More information about the Koha-cvs mailing list