Bugzilla – Attachment 119651 Details for
Bug 28001
Fix delete_patrons.pl if no category is passed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28001: (QA follow-up) Clarify messages and indicate test mode
Bug-28001-QA-follow-up-Clarify-messages-and-indica.patch (text/plain), 2.78 KB, created by
Nick Clemens (kidclamp)
on 2021-04-15 15:44:20 UTC
(
hide
)
Description:
Bug 28001: (QA follow-up) Clarify messages and indicate test mode
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-15 15:44:20 UTC
Size:
2.78 KB
patch
obsolete
>From c0c1978342df5410bf5e12521c6ac96a56613961 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 15 Apr 2021 15:43:23 +0000 >Subject: [PATCH] Bug 28001: (QA follow-up) Clarify messages and indicate test > mode > >--- > misc/cronjobs/delete_patrons.pl | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl >index 1f6bcc9a25..d0847c8b62 100755 >--- a/misc/cronjobs/delete_patrons.pl >+++ b/misc/cronjobs/delete_patrons.pl >@@ -93,28 +93,28 @@ unless ($confirm) { > $verbose ||= 1; > } > >-say scalar(@$members) . " patrons to delete" if $verbose;; >+say scalar(@$members) . " patrons match conditions" if $verbose;; > > my $anonymous_patron = C4::Context->preference("AnonymousPatron"); > my $deleted = 0; > for my $member (@$members) { >- print "Trying to delete patron $member->{borrowernumber}... " >+ print "Testing that we can delete patron $member->{borrowernumber}... " > if $verbose; > > my $borrowernumber = $member->{borrowernumber}; > my $patron = Koha::Patrons->find( $borrowernumber ); > unless ( $patron ) { >- say "Patron with borrowernumber $borrowernumber does not exist"; >+ say "Cannot delete: Patron with borrowernumber $borrowernumber does not exist"; > 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" if $verbose; >+ say "Cannot delete patron $borrowernumber: patron has $charges in fines" if $verbose; > next; > } > > if ( $anonymous_patron ) { > if ( $patron->id eq $anonymous_patron ) { >- say "Failed to delete patron $borrowernumber: patron is AnonymousPatron"; >+ say "Cannot delete patron $borrowernumber: patron is AnonymousPatron"; > next; > } > } >@@ -122,13 +122,13 @@ for my $member (@$members) { > if ( $confirm ) { > my $deleted = eval { $patron->move_to_deleted; }; > if ($@ or not $deleted) { >- say "Failed to delete patron $borrowernumber, cannot move it" . ( $@ ? ": ($@)" : "" ) if $verbose; >+ say "Cannot delete patron $borrowernumber, cannot move it" . ( $@ ? ": ($@)" : "" ) if $verbose; > next; > } > > eval { $patron->delete }; > if ($@) { >- say "Failed to delete patron $borrowernumber: $@)"; >+ say "Cannot delete patron $borrowernumber: $@)"; > next; > } > } >@@ -136,7 +136,8 @@ for my $member (@$members) { > say "OK" if $verbose; > } > >-say "$deleted patrons deleted" if $verbose; >+ >+say $confirm ? "$deleted patrons deleted" : "$deleted patrons would have been 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 28001
:
119363
|
119387
|
119650
| 119651