Bugzilla – Attachment 134616 Details for
Bug 30354
AUTO_RENEWALS_DGST notices are not generated if patron set to receive notice via SMS and no SMS notice defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30354: Don't assign warn as letter
Bug-30354-Dont-assign-warn-as-letter.patch (text/plain), 3.14 KB, created by
Joonas Kylmälä
on 2022-05-04 16:49:52 UTC
(
hide
)
Description:
Bug 30354: Don't assign warn as letter
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-05-04 16:49:52 UTC
Size:
3.14 KB
patch
obsolete
>From bd4e6a63f65b37f55f8a8c226f6dd9771279575f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 24 Mar 2022 15:31:05 +0000 >Subject: [PATCH] Bug 30354: Don't assign warn as letter >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >TO test: >1 - Check out an item marked for autop renewal to a patron and make it overdue >2 - Set system preference AutoRenewalNotices to follow messaging prefs >3 - set that borrower to receive both email and SMS AUTO_RENEWALS_DGST >4 - confirm your AUTO_RENEWALS_DGST does not have SMS content but does have email >5 - run the auto_renew cron >6 - item is renewed, but error from cron, and cron dies: > >No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583. >no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/automatic_renewals.pl line 305. >Can't use string ("1") as a HASH ref while "strict refs" in use at /kohadevbox/koha/C4/Letters.pm line 898. > >7 - Apply patch >8 - Make item eligible for auto renewal agian (or checkin/checkout) >9 - Run the cron >10 - There is still 2 warn, but cron does not die: > >No circulation AUTO_RENEWALS_DGST letter transported by sms at /kohadevbox/koha/C4/Letters.pm line 583. >no letter of type 'AUTO_RENEWALS_DGST' found for borrowernumber 5. Please see sample_notices.sql at misc/cronjobs/ automatic_renewals.pl line 305. > >11 - Patron receives email and item is renewed > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > misc/cronjobs/automatic_renewals.pl | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index a80c166ee0..1af18c70f5 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -328,16 +328,23 @@ sub send_digests { > borrowers => $patron->borrowernumber, > }, > message_transport_type => $transport, >- ) || warn "no letter of type '$params->{letter_code}' found for borrowernumber $borrowernumber. Please see sample_notices.sql"; >+ ); > >- next unless $letter; >+ if ($letter) { >+ C4::Letters::EnqueueLetter( >+ { >+ letter => $letter, >+ borrowernumber => $borrowernumber, >+ from_address => $from_address, >+ message_transport_type => $transport >+ } >+ ); >+ } >+ else { >+ warn >+"no letter of type '$params->{letter_code}' found for borrowernumber $borrowernumber. Please see sample_notices.sql"; >+ } > >- C4::Letters::EnqueueLetter({ >- letter => $letter, >- borrowernumber => $borrowernumber, >- from_address => $from_address, >- message_transport_type => $transport >- }); > } > } > } >-- >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 30354
:
132180
|
134435
| 134616