Bug 6912 Test 008 presence in get CoinS function
authorFrédéric Demians <f.demians@tamil.fr>
Sun, 25 Sep 2011 09:25:25 +0000 (11:25 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 13 Oct 2011 02:57:18 +0000 (15:57 +1300)
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Biblio.pm

index 102fa0f..752ebe9 100644 (file)
@@ -1219,7 +1219,8 @@ sub GetCOinSBiblio {
         $subtitle = $record->subfield( '245', 'b' ) || '';
         $title .= $subtitle;
         if ($titletype eq 'a') {
-            $pubyear   = substr $record->field('008')->data(), 7, 4;
+            $pubyear   = $record->field('008') || '';
+            $pubyear   = substr($pubyear->data(), 7, 4) if $pubyear;
             $isbn      = $record->subfield( '773', 'z' ) || '';
             $issn      = $record->subfield( '773', 'x' ) || '';
             if ($mtx eq 'journal') {