From b25ace0be416e1720bf1d774b869f9005b9f3ae8 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Mon, 22 Oct 2007 03:19:47 -0500 Subject: [PATCH] bugfix : handling biblionumber in a field < 010 the bug occur only if we have a malformed biblio, so it should "never" happend, but i've seen it once ;-) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 1b93f0fa80..d192b131cd 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -393,12 +393,19 @@ sub ModBiblio { # adding biblionumber my ($tag_biblionumber, $subfield_biblionumber) = GetMarcFromKohaField('biblio.biblionumber',$frameworkcode); - $record->append_fields( - MARC::Field->new( - $tag_biblionumber,'','',$subfield_biblionumber => $biblionumber - ) - ) unless ($record->subfield($tag_biblionumber,$subfield_biblionumber)); - + if ($tag_biblionumber < 10) { + $record->append_fields( + MARC::Field->new( + $tag_biblionumber, $biblionumber + ) + ) unless $record->field($tag_biblionumber); + } else { + $record->append_fields( + MARC::Field->new( + $tag_biblionumber,'','',$subfield_biblionumber => $biblionumber + ) + ) unless ($record->subfield($tag_biblionumber,$subfield_biblionumber)); + } # update the MARC record (that now contains biblio and items) with the new record data &ModBiblioMarc( $record, $biblionumber, $frameworkcode ); -- 2.39.5