From e8813e757873102f1b1a2dcbb9063374317281b3 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 27 Apr 2009 10:31:03 -0500 Subject: [PATCH] bug 2915 followup - small efficiency improvement Following up on a suggestion by Joe Atzberger, save a database query by not counting the subscriptions to delete; instead, simply fetch a list of them. No user-visible change. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Biblio.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ddf711f00a..1c5f1eefe2 100755 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -365,11 +365,9 @@ 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}); - } + 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 -- 2.39.5