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 <galen.charlton@liblime.com>
This commit is contained in:
Galen Charlton 2009-04-27 10:31:03 -05:00
parent 46037ac61a
commit a2b1922b66

View file

@ -379,12 +379,10 @@ 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 :