Bug 6480 - Koha produces a lot of apache logs for UNIMARC
authorJanusz Kaczmarek <januszop@gmail.com>
Tue, 7 Jun 2011 19:28:24 +0000 (22:28 +0300)
committerChris Cormack <chrisc@catalyst.net.nz>
Sat, 16 Jul 2011 08:25:31 +0000 (20:25 +1200)
For Koha with UNIMARC a lot of entries in apache log lines are produced.

In the patch, corrections to the GetCOinSBiblio function has been introduces,
in the UNIMARC section: (i.e. || '' at the end of lines that can create this
problem) -- analogous as it is in the MARC21 section.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Biblio.pm

index 33908f9..a91562c 100644 (file)
@@ -1180,8 +1180,8 @@ sub GetCOinSBiblio {
     if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
 
         # Setting datas
-        $aulast  = $record->subfield( '700', 'a' );
-        $aufirst = $record->subfield( '700', 'b' );
+        $aulast  = $record->subfield( '700', 'a' ) || '';
+        $aufirst = $record->subfield( '700', 'b' ) || '';
         $oauthors = "&amp;rft.au=$aufirst $aulast";
 
         # others authors
@@ -1194,10 +1194,10 @@ sub GetCOinSBiblio {
           ( $mtx eq 'dc' )
           ? "&amp;rft.title=" . $record->subfield( '200', 'a' )
           : "&amp;rft.title=" . $record->subfield( '200', 'a' ) . "&amp;rft.btitle=" . $record->subfield( '200', 'a' );
-        $pubyear   = $record->subfield( '210', 'd' );
-        $publisher = $record->subfield( '210', 'c' );
-        $isbn      = $record->subfield( '010', 'a' );
-        $issn      = $record->subfield( '011', 'a' );
+        $pubyear   = $record->subfield( '210', 'd' ) || '';
+        $publisher = $record->subfield( '210', 'c' ) || '';
+        $isbn      = $record->subfield( '010', 'a' ) || '';
+        $issn      = $record->subfield( '011', 'a' ) || '';
     } else {
 
         # MARC21 need some improve