From 9611b9967eda3367dc671e44a6e62e2e4f8b1b98 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 Dec 2021 14:44:07 +0100 Subject: [PATCH] Bug 9565: Use Koha::Biblio Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- tools/batch_delete_records.pl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index 0f42bd8ede..11c412d465 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -28,7 +28,6 @@ use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use C4::Auth qw( get_template_and_user ); use C4::Biblio qw( GetMarcBiblio ); -use C4::Serials qw( CountSubscriptionFromBiblionumber); use C4::AuthoritiesMarc; use Koha::Virtualshelves; @@ -92,8 +91,8 @@ if ( $op eq 'form' ) { for my $record_id ( uniq @record_ids ) { if ( $recordtype eq 'biblio' ) { # Retrieve biblio information - my $biblio = Koha::Biblios->find( $record_id ); - unless ( $biblio ) { + my $biblio_object = Koha::Biblios->find( $record_id ); + unless ( $biblio_object ) { push @messages, { type => 'warning', code => 'biblio_not_exists', @@ -101,13 +100,12 @@ if ( $op eq 'form' ) { }; next; } - my $holds_count = $biblio->holds->count; - $biblio = $biblio->unblessed; + my $biblio = $biblio_object->unblessed; my $record = &GetMarcBiblio({ biblionumber => $record_id }); $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')]; - $biblio->{holds_count} = $holds_count; + $biblio->{holds_count} = $biblio_object->holds->count; $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id ); - $biblio->{subscriptions_count} = CountSubscriptionFromBiblionumber( $record_id ); + $biblio->{subscriptions_count} = $biblio_object->subscriptions->count; push @records, $biblio; } else { # Retrieve authority information -- 2.39.5