Bugzilla – Attachment 175209 Details for
Bug 35654
Add option to delete_items.pl to delete record if existing item getting deleted is the only one attached to the bib
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35654: (follow-up) Fix $holdings_count
Bug-35654-follow-up-Fix-holdingscount.patch (text/plain), 1.53 KB, created by
Brendan Lawlor
on 2024-12-04 20:51:05 UTC
(
hide
)
Description:
Bug 35654: (follow-up) Fix $holdings_count
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-12-04 20:51:05 UTC
Size:
1.53 KB
patch
obsolete
>From 1e4e276fe3c1355caca3e1a37fe706b397066664 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Wed, 4 Dec 2024 20:47:19 +0000 >Subject: [PATCH] Bug 35654: (follow-up) Fix $holdings_count > >Fix the off by one error in the holdings_count to >accurately print the number of remaining items. >--- > misc/cronjobs/delete_items.pl | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/delete_items.pl b/misc/cronjobs/delete_items.pl >index 8e09271f54..75ffec6ee1 100755 >--- a/misc/cronjobs/delete_items.pl >+++ b/misc/cronjobs/delete_items.pl >@@ -57,17 +57,15 @@ my $items = Koha::Items->search( \$where_clause ); > > DELITEM: while ( my $item = $items->next ){ > >- my $holdings_count = $item->biblio->items->count; >- my $error; >- > my $safe_to_delete = $item->safe_to_delete; > if ($safe_to_delete) { >+ my $holdings_count = $item->biblio->items->count - 1; > $item->safe_delete > if $commit; > $verbose && say "$deleted_string item " . $item->itemnumber . " ($holdings_count items remain on record)"; > >- if ( $delete_biblios && $holdings_count == 1 ) { # aka DO-EET for empty bibs! >- $error = &DelBiblio( $item->biblionumber ) if $commit; >+ if ( $delete_biblios && $holdings_count == 0 ) { # aka DO-EET for empty bibs! >+ my $error = &DelBiblio( $item->biblionumber ) if $commit; > if ($error) { > $verbose && say "Could not delete bib " . $item->biblionumber . ": $error"; > } else { >-- >2.39.5
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 35654
:
174480
|
174529
|
175193
|
175194
|
175195
|
175208
|
175209
|
176936
|
176937
|
177868
|
179675