Bugzilla – Attachment 155165 Details for
Bug 33522
Optionally skip (in)active patrons when sending membership expiry notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33522: (follow-up) Do not rely on fallback
Bug-33522-follow-up-Do-not-rely-on-fallback.patch (text/plain), 2.59 KB, created by
Marcel de Rooy
on 2023-09-02 07:23:14 UTC
(
hide
)
Description:
Bug 33522: (follow-up) Do not rely on fallback
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-09-02 07:23:14 UTC
Size:
2.59 KB
patch
obsolete
>From 4c79c29e3c059512b285a2575d8fcc789443abef Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Sat, 2 Sep 2023 07:05:22 +0000 >Subject: [PATCH] Bug 33522: (follow-up) Do not rely on fallback >Content-Type: text/plain; charset=utf-8 > >Bug 33245 has been adjusted; the fallback has been removed. >We should check now if the -active or -inactive parameter >actually has been passed. > >Test plan: >See earlier test plan. >Run the script without active/inactive. >Run the script with active. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > misc/cronjobs/membership_expiry.pl | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > >diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl >index e8485663e1..c80eccf07b 100755 >--- a/misc/cronjobs/membership_expiry.pl >+++ b/misc/cronjobs/membership_expiry.pl >@@ -191,7 +191,7 @@ GetOptions( > > pod2usage( -verbose => 2 ) if $man; > pod2usage(1) if $help || !$confirm; >-if( defined($active) && defined($inactive) ) { >+if ( defined($active) && defined($inactive) ) { > print "Sorry, it is not possible to pass both -active as well as -inactive.\n"; > exit; > } >@@ -223,14 +223,13 @@ warn 'found ' . $upcoming_mem_expires->count . ' soon expiring members' > > # main loop > $letter_type = 'MEMBERSHIP_EXPIRY' if !$letter_type; >-my ( $count_active, $count_inactive, $count_enqueued ) = ( 0, 0, 0 ); >+my ( $count_skipped, $count_enqueued ) = ( 0, 0 ); > while ( my $recent = $upcoming_mem_expires->next ) { >- my $patron_active = $recent->is_active({ months => $active // $inactive }); # checked already that only one is defined >- if( defined($active) && !$patron_active ) { >- $count_inactive++; >+ if ( $active && !$recent->is_active( { months => $active } ) ) { >+ $count_skipped++; > next; >- } elsif( defined($inactive) && $patron_active ) { >- $count_active++; >+ } elsif ( $inactive && $recent->is_active( { months => $inactive } ) ) { >+ $count_skipped++; > next; > } > my $from_address = $recent->library->from_email_address; >@@ -280,10 +279,10 @@ while ( my $recent = $upcoming_mem_expires->next ) { > } > } > >-if( $verbose ) { >+if ($verbose) { > print "Enqueued notices for $count_enqueued patrons\n"; >- print "Skipped $count_active active patrons\n" if $count_active; >- print "Skipped $count_inactive inactive patrons\n" if $count_inactive; >+ print "Skipped $count_skipped inactive patrons\n" if $active; >+ print "Skipped $count_skipped active patrons\n" if $inactive; > } > > cronlogaction({ action => 'End', info => "COMPLETED" }); >-- >2.30.2
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 33522
:
151885
|
151986
|
155164
|
155165
|
156531
|
156532