From e90115293af43559e73a36213259af6cecb42c01 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 31 Oct 2007 13:38:01 -0500 Subject: [PATCH] bugfix: deletedbiblioitems row now added upon delete of a biblio Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 6c9fe4ea16..ab33ee4ca0 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -565,9 +565,6 @@ sub DelBiblio { # and we would have no way to remove it (except manually in zebra, but I bet it would be very hard to handle the problem) ModZebra($biblionumber, "delete_record", "biblioserver", undef); - # delete biblio from Koha tables and save in deletedbiblio - $error = &_koha_delete_biblio( $dbh, $biblionumber ); - # delete biblioitems and items from Koha tables and save in deletedbiblioitems,deleteditems $sth = $dbh->prepare( @@ -576,9 +573,16 @@ sub DelBiblio { while ( my $biblioitemnumber = $sth->fetchrow ) { # delete this biblioitem - $error = &_koha_delete_biblioitems( $dbh, $biblioitemnumber ); + $error = _koha_delete_biblioitems( $dbh, $biblioitemnumber ); return $error if $error; } + + # delete biblio from Koha tables and save in deletedbiblio + # must do this *after* _koha_delete_biblioitems, otherwise + # delete cascade will prevent deletedbiblioitems rows + # from being generated by _koha_delete_biblioitems + $error = _koha_delete_biblio( $dbh, $biblionumber ); + &logaction(C4::Context->userenv->{'number'},"CATALOGUING","DELETE",$biblionumber,"") if C4::Context->preference("CataloguingLog"); return; -- 2.39.5