[Koha-patches] [PATCH] Fixes fatal-error if bib has no $100a.

Mason James mason at kohaaloha.com
Tue Aug 3 10:37:26 CEST 2010


this patch fixes a fatal-error (below), if bib has no $100a subfield..

Can't call method "subfield" on an undefined value at /usr/share/koha/lib/C4/Biblio.pm line 1273.'

applied to 3.0.6
---
 C4/Biblio.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index c0777ab..364f1cf 100755
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -1264,7 +1264,7 @@ sub GetBiblioSummary {
         $str="<b>".$marc->subfield('245',"a")."</b>" if $marc->subfield('245','a');
         $str.= " <i>".$marc->subfield('245',"b")."</i> " if $marc->subfield('245','b');
         
-        if ($marc->field('245')){
+        if ($marc->field('245') and $marc->field('100')) {
             $str.=" / ";
             foreach ($marc->field('100')->subfield("a")) {
                 $str.=$_." ; ";
-- 
1.5.6.5



More information about the Koha-patches mailing list