From 43bb27b8dae92f26ce348a735b86497ea1f42a24 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 6 Mar 2009 11:37:55 +0100 Subject: [PATCH] (bug #2915) C4::Biblio::DelBiblio delete the serials This patch add the serials deletion in DelBiblio function, so now when a record is deleted all attached serials will be too. Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- C4/Biblio.pm | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100755 => 100644 C4/Biblio.pm diff --git a/C4/Biblio.pm b/C4/Biblio.pm old mode 100755 new mode 100644 index 60823a0aab..27eebe9fbd --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -31,6 +31,7 @@ use C4::Log; # logaction use C4::ClassSource; use C4::Charset; require C4::Heading; +require C4::Serials; use vars qw($VERSION @ISA @EXPORT); @@ -376,6 +377,14 @@ sub DelBiblio { return $error if $error; + # We delete attached subscriptions + if(C4::Serials::CountSubscriptionFromBiblionumber($biblionumber) != 0){ + my $subscriptions = &C4::Serials::GetFullSubscriptionsFromBiblionumber($biblionumber); + foreach my $subscription (@$subscriptions){ + &C4::Serials::DelSubscription($subscription->{subscriptionid}); + } + } + # Delete in Zebra. Be careful NOT to move this line after _koha_delete_biblio # for at least 2 reasons : # - we need to read the biblio if NoZebra is set (to remove it from the indexes -- 2.39.2