Bugzilla – Attachment 104572 Details for
Bug 25157
delete_patrons.pl is never quiet, even when run without -v
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25157: Silent patron deletion cmd line script
Bug-25157-Silent-patron-deletion-cmd-line-script.patch (text/plain), 2.05 KB, created by
Marcel de Rooy
on 2020-05-08 09:50:04 UTC
(
hide
)
Description:
Bug 25157: Silent patron deletion cmd line script
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-05-08 09:50:04 UTC
Size:
2.05 KB
patch
obsolete
>From 7a8c8ec2c2c3d9af24a5e0ccad4652ac47eb04dd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 Apr 2020 12:24:24 +0200 >Subject: [PATCH] Bug 25157: Silent patron deletion cmd line script >Content-Type: text/plain; charset=utf-8 > >Without -v the script will no longer display messages unless the error >is major. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > misc/cronjobs/delete_patrons.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl >index 8129359aec..3d25cb743a 100755 >--- a/misc/cronjobs/delete_patrons.pl >+++ b/misc/cronjobs/delete_patrons.pl >@@ -89,9 +89,10 @@ if (!defined $members and @file_members) { > unless ($confirm) { > say "Doing a dry run; no patron records will actually be deleted."; > say "Run again with --confirm to delete the records."; >+ $verbose ||= 1; > } > >-say scalar(@$members) . " patrons to delete"; >+say scalar(@$members) . " patrons to delete" if $verbose;; > > my $deleted = 0; > for my $member (@$members) { >@@ -105,14 +106,14 @@ for my $member (@$members) { > next; > } > if ( my $charges = $patron->account->non_issues_charges ) { # And what if we owe to this patron? >- say "Failed to delete patron $borrowernumber: patron has $charges in fines"; >+ say "Failed to delete patron $borrowernumber: patron has $charges in fines" if $verbose; > next; > } > > if ( $confirm ) { > my $deleted = eval { $patron->move_to_deleted; }; > if ($@ or not $deleted) { >- say "Failed to delete patron $borrowernumber, cannot move it" . ( $@ ? ": ($@)" : "" ); >+ say "Failed to delete patron $borrowernumber, cannot move it" . ( $@ ? ": ($@)" : "" ) if $verbose; > next; > } > >@@ -126,7 +127,7 @@ for my $member (@$members) { > say "OK" if $verbose; > } > >-say "$deleted patrons deleted"; >+say "$deleted patrons deleted" if $verbose; > > =head1 NAME > >-- >2.11.0
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 25157
:
103140
|
103196
| 104572