Bugzilla – Attachment 183769 Details for
Bug 40076
Add --skip-no-email parameter to borrowers-force-messaging-defaults.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40076: Add --skip-no-email parameter to borrowers-force-messaging-defaults.pl
Bug-40076-Add---skip-no-email-parameter-to-borrowe.patch (text/plain), 2.73 KB, created by
Hammat wele
on 2025-07-03 15:56:18 UTC
(
hide
)
Description:
Bug 40076: Add --skip-no-email parameter to borrowers-force-messaging-defaults.pl
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-07-03 15:56:18 UTC
Size:
2.73 KB
patch
obsolete
>From 108ddd213e9e90a908ce2ebed0fa987a78c85b00 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Thu, 3 Jul 2025 14:31:46 +0000 >Subject: [PATCH] Bug 40076: Add --skip-no-email parameter to > borrowers-force-messaging-defaults.pl > >This patch adds a new parameter to skip borrowers without an email address. > >To test: >1 - Create a new patron without an email address and note their borrowernumber. >2 - Run ./misc/maintenance/borrowers-force-messaging-defaults.pl > ==> The patron created in step 1 should be processed. >3 - Repeat step 2 with the --skip-no-email parameter. > ==> The patron created in step 1 should not be processed. >--- > .../borrowers-force-messaging-defaults.pl | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > >diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl >index 6e27a7c3bad..4b2f1594f14 100755 >--- a/misc/maintenance/borrowers-force-messaging-defaults.pl >+++ b/misc/maintenance/borrowers-force-messaging-defaults.pl >@@ -32,7 +32,7 @@ sub usage { > } > > sub force_borrower_messaging_defaults { >- my ( $doit, $since, $not_expired, $no_overwrite, $category, $branchcode, $message_name ) = @_; >+ my ( $doit, $since, $not_expired, $no_overwrite, $category, $branchcode, $message_name, $skip_no_email ) = @_; > > print "Since: $since\n" if $since; > >@@ -43,6 +43,12 @@ sub force_borrower_messaging_defaults { > LEFT JOIN borrower_message_preferences mp USING (borrowernumber) > WHERE 1|; > >+ if ($skip_no_email) { >+ $sql .= >+ " AND ( (bo.email IS NOT NULL AND bo.email <> '')" >+ . " OR (bo.emailpro IS NOT NULL AND bo.emailpro <> '')" >+ . " OR (bo.B_email IS NOT NULL AND bo.B_email <> '') )"; >+ } > if ($since) { > $sql .= " AND bo.dateenrolled >= ?"; > } >@@ -72,7 +78,7 @@ WHERE 1|; > print "Total borrowers updated: $cnt\n" if $doit; > } > >-my ( $doit, $since, $help, $not_expired, $no_overwrite, $category, $branchcode, $message_name ); >+my ( $doit, $since, $help, $not_expired, $no_overwrite, $category, $branchcode, $message_name, $skip_no_email ); > my $result = GetOptions( > 'doit' => \$doit, > 'since:s' => \$since, >@@ -82,11 +88,15 @@ my $result = GetOptions( > 'library:s' => \$branchcode, > 'message-name:s' => \$message_name, > 'help|h' => \$help, >+ 'skip-no-email' => \$skip_no_email, > ); > > usage() if $help; > >-force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category, $branchcode, $message_name ); >+force_borrower_messaging_defaults( >+ $doit, $since, $not_expired, $no_overwrite, $category, $branchcode, $message_name, >+ $skip_no_email >+); > > =head1 NAME > >-- >2.34.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 40076
: 183769