From 9144d67850989849f95d800fa739fd958c22ed4d Mon Sep 17 00:00:00 2001 From: rangi Date: Sun, 21 Apr 2002 06:33:32 +0000 Subject: [PATCH] Fixing bug reported by Steve, Couldnt remove an additional Author when modifying a biblio --- C4/Acquisitions.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/C4/Acquisitions.pm b/C4/Acquisitions.pm index 38bfbcf9f7..7ccadbddbf 100644 --- a/C4/Acquisitions.pm +++ b/C4/Acquisitions.pm @@ -18,6 +18,7 @@ $VERSION = 0.01; &findall &needsmod &delitem &delbibitem &delbiblio &delorder &branches &getallorders &getrecorders &updatecurrencies &getorder &getcurrency &updaterecorder &updatecost &checkitems &modnote &getitemtypes &getbiblio); + %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -419,8 +420,6 @@ notes = $biblio->{'notes'}"; sub modbiblio { my ($bibnum,$title,$author,$copyright,$seriestitle,$serial,$unititle,$notes)=@_; my $dbh=C4Connect; - #$title=~ s/\'/\\\'/g; - #$author=~ s/\'/\\\'/g; my $query="update biblio set title='$title', author='$author',copyrightdate='$copyright', seriestitle='$seriestitle',serial='$serial',unititle='$unititle',notes='$notes' @@ -448,12 +447,14 @@ sub modaddauthor { my $dbh=C4Connect; my $query="Delete from additionalauthors where biblionumber=$bibnum"; my $sth=$dbh->prepare($query); - $sth->execute; - $query="insert into additionalauthors (author,biblionumber) values ('$author','$bibnum')"; - $sth->finish; - $sth=$dbh->prepare($query); $sth->execute; $sth->finish; + if ($author ne ''){ + $query="insert into additionalauthors (author,biblionumber) values ('$author','$bibnum')"; + $sth=$dbh->prepare($query); + $sth->execute; + $sth->finish; + } $dbh->disconnect; } -- 2.39.5