Bugzilla – Attachment 128281 Details for
Bug 9565
Deleting a record should alert or fail if there are current subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9565: Use Koha::Biblio
Bug-9565-Use-KohaBiblio.patch (text/plain), 2.27 KB, created by
Jonathan Druart
on 2021-12-06 13:45:49 UTC
(
hide
)
Description:
Bug 9565: Use Koha::Biblio
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-12-06 13:45:49 UTC
Size:
2.27 KB
patch
obsolete
>From 41c4cfda612ba60eb929183a0dd031dfdfb09a54 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Dec 2021 14:44:07 +0100 >Subject: [PATCH] Bug 9565: Use Koha::Biblio > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 0f42bd8ede4..11c412d4657 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.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9565
:
113589
|
113591
|
126821
|
126905
|
128051
|
128160
|
128163
|
128164
|
128165
|
128278
|
128279
|
128280
| 128281 |
128764
|
128832