From d17a72ed5b23ef8e67ce21ae974a7076b21ea62b Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 22 Jan 2010 17:02:17 +0100 Subject: [PATCH] (MT 2671): Serial management in koha_add_biblio serial management in koha_add_biblio is only relying on presence of $biblio->{seriestitle} It is not correct, $biblio->{serial} definition should prevail over this test --- C4/Biblio.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8b918dbff3..ded50fc254 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2971,8 +2971,10 @@ sub _koha_add_biblio { my $error; # set the series flag - my $serial = 0; - if ( $biblio->{'seriestitle'} ) { $serial = 1 } + unless (defined $biblio->{'serial'}){ + $biblio->{'serial'} = 0; + if ( $biblio->{'seriestitle'} ) { $biblio->{'serial'} = 1 } + } my $query = "INSERT INTO biblio SET frameworkcode = ?, @@ -2989,7 +2991,7 @@ sub _koha_add_biblio { my $sth = $dbh->prepare($query); $sth->execute( $frameworkcode, $biblio->{'author'}, $biblio->{'title'}, $biblio->{'unititle'}, $biblio->{'notes'}, - $serial, $biblio->{'seriestitle'}, $biblio->{'copyrightdate'}, $biblio->{'abstract'} + $biblio->{'serial'}, $biblio->{'seriestitle'}, $biblio->{'copyrightdate'}, $biblio->{'abstract'} ); my $biblionumber = $dbh->{'mysql_insertid'}; -- 2.39.5