[open-ils-commits] r16248 - branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Apr 16 10:34:12 EDT 2010


Author: dbs
Date: 2010-04-16 10:34:10 -0400 (Fri, 16 Apr 2010)
New Revision: 16248

Modified:
   branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
Backport r16247 to avoid unwanted marc8_to_utf8 conversion of records with incorrect leaders


Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-04-16 04:38:02 UTC (rev 16247)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-04-16 14:34:10 UTC (rev 16248)
@@ -1666,7 +1666,7 @@
 			'open-ils.search.biblio.multiclass.query' => {offset => $offset, limit => $limit} => $search_string => 1
 		)->gather(1);
 
-        my $bre = $supercat->request( 'open-ils.supercat.record.object.retrieve' => [ map { $_->[0] } @{$recs->{ids}} ] )->gather(1);
+		my $bre = $supercat->request( 'open-ils.supercat.record.object.retrieve' => [ map { $_->[0] } @{$recs->{ids}} ] )->gather(1);
 
 		foreach my $record (@$bre) {
 			my $marcxml = $record->marc;
@@ -1677,6 +1677,13 @@
 				my $bib_holdings = $supercat->request('open-ils.supercat.record.basic_holdings.retrieve', $record->id, $shortname || '-')->gather(1);
 				my $marc = MARC::Record->new_from_xml($marcxml, 'UTF8', 'XML');
 
+				# Force record leader to 'a' as our data is always UTF8
+				# Avoids marc8_to_utf8 from being invoked with horrible results
+				# on the off-chance the record leader isn't correct
+				my $ldr = $marc->leader;
+				substr($ldr, 9, 1, 'a');
+				$marc->leader($ldr);
+
 				# Expects the record ID in the 001
 				$marc->delete_field($_) for ($marc->field('001'));
 				if (!$marc->field('001')) {
@@ -1724,9 +1731,9 @@
 			);
 		}
 
-        $resp->numberOfRecords($recs->{count});
+		$resp->numberOfRecords($recs->{count});
 
-    } elsif ( $resp->type eq 'explain' ) {
+	} elsif ( $resp->type eq 'explain' ) {
 		if (!$ex_doc) {
 			my $host = $cgi->virtual_host || $cgi->server_name;
 
@@ -1791,9 +1798,9 @@
 		);
 	}
 
-   	print $cgi->header( -type => 'application/xml' );
-   	print $U->entityize($resp->asXML) . "\n";
-    return Apache2::Const::OK;
+	print $cgi->header( -type => 'application/xml' );
+	print $U->entityize($resp->asXML) . "\n";
+	return Apache2::Const::OK;
 }
 
 



More information about the open-ils-commits mailing list