Bugzilla – Attachment 126222 Details for
Bug 29223
Auto-renewals can fail when not digested per branch and patron requests digest
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29223: Use patron's branchcode for digest if not sending digest per branch
Bug-29223-Use-patrons-branchcode-for-digest-if-not.patch (text/plain), 2.66 KB, created by
Nick Clemens (kidclamp)
on 2021-10-13 15:48:59 UTC
(
hide
)
Description:
Bug 29223: Use patron's branchcode for digest if not sending digest per branch
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-13 15:48:59 UTC
Size:
2.66 KB
patch
obsolete
>From 3147524168867754e5c97dde7185a932aac3b5a8 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 13 Oct 2021 15:20:05 +0000 >Subject: [PATCH] Bug 29223: Use patron's branchcode for digest if not sending > digest per branch > >To test: > 1 - Set system preference AutoRenewalNotices to 'according to patron messaging preferences' > 2 - Set circ rule for auto renewal - 100 renewals allowed - no renewal before 100 > This shoud make a checkout eligible for many auto renewals for testing > 3 - Checkout an item to a patron, ensure item is from a different branch than patron > 4 - Ensure the patron has an email, and set an email for patron's branch and items branch > 5 - Set the patron messaging preferences for auto-renewal to 'email' and 'wants digest' > 6 - perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm > 7 - Job dies: > Can't call method "from_email_address" on an undefined value at /usr/share/koha/bin/cronjobs/automatic_renewals.pl line 286. > 8 - Apply patch > 9 - Repeat >10 - NO errors >11 - Check patron notices tab, should be a notice enqueued, check DB to see from address is patron's branch >12 - perl misc/cronjobs/automatic_renewals.pl --send-notices --confirm --digest-per-branch >13 - No errors >14 - Check patron notices tab, should be a notice enqueued, check DB to see from address is item's branch >--- > misc/cronjobs/automatic_renewals.pl | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index cb45e68cbd..d972dd79d6 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -282,14 +282,20 @@ sub send_digests { > next PATRON unless $borrower_preferences; # how could this happen? > > my $patron = Koha::Patrons->find( $borrowernumber ); >- my $library = Koha::Libraries->find( $params->{branchcode} ); >+ my $branchcode; >+ if ( defined $params->{branchcode} ) { >+ $branchcode = $params->{branchcode}; >+ } else { >+ $branchcode = $patron->branchcode; >+ } >+ my $library = Koha::Libraries->find( $branchcode ); > my $from_address = $library->from_email_address; > > foreach my $transport ( keys %{ $borrower_preferences->{'transports'} } ) { > my $letter = C4::Letters::GetPreparedLetter ( > module => 'circulation', > letter_code => $params->{letter_code}, >- branchcode => $params->{branchcode}, >+ branchcode => $branchcode, > lang => $patron->lang, > substitute => { > error => $digest->{error}||0, >-- >2.20.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 29223
:
126222
|
126228
|
127137