Bugzilla – Attachment 131199 Details for
Bug 17648
ACCTDETAILS notice doesn't show in the notices tab in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17648: ACCTDETAILS notice does not show in notices.pl
Bug-17648-ACCTDETAILS-notice-does-not-show-in-noti.patch (text/plain), 4.71 KB, created by
Martin Renvoize (ashimema)
on 2022-03-01 16:30:11 UTC
(
hide
)
Description:
Bug 17648: ACCTDETAILS notice does not show in notices.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-01 16:30:11 UTC
Size:
4.71 KB
patch
obsolete
>From edbcc299a5c77003d969c78409f0ae4118a1f72c Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Mon, 28 Feb 2022 09:03:29 -0500 >Subject: [PATCH] Bug 17648: ACCTDETAILS notice does not show in notices.pl > >The ACCTDETAILS notice apparently bypasses message_queue; notices are sent directly to the linux mail queue. > >Test Plan: >1) Apply this patch >2) Create a new patron with an email address >3) Note the patron's ACCTDETAILS notice shows in the patron's messages > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Letters.pm | 50 ------------------------------------------ > members/memberentry.pl | 29 ++++++++++++++++++------ > 2 files changed, 22 insertions(+), 57 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index c36553ac9a..2a9893555d 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -529,56 +529,6 @@ sub SendAlerts { > . $letter->{content} > ) if C4::Context->preference("ClaimsLog"); > } >- # send an "account details" notice to a newly created user >- elsif ( $type eq 'members' ) { >- my $library = Koha::Libraries->find( $externalid->{branchcode} ); >- my $letter = GetPreparedLetter ( >- module => 'members', >- letter_code => $letter_code, >- branchcode => $externalid->{'branchcode'}, >- lang => $externalid->{lang} || 'default', >- tables => { >- 'branches' => $library->unblessed, >- 'borrowers' => $externalid->{'borrowernumber'}, >- }, >- substitute => { 'borrowers.password' => $externalid->{'password'} }, >- want_librarian => 1, >- ) or return; >- return { error => "no_email" } unless $externalid->{'emailaddr'}; >- >- my $success = try { >- >- # FIXME: This 'default' behaviour should be moved to Koha::Email >- my $mail = Koha::Email->create( >- { >- to => $externalid->{'emailaddr'}, >- from => $library->branchemail, >- reply_to => $library->branchreplyto, >- sender => $library->branchreturnpath, >- subject => "" . $letter->{'title'}, >- } >- ); >- >- if ( $letter->{is_html} ) { >- $mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) ); >- } >- else { >- $mail->text_body( $letter->{content} ); >- } >- >- $mail->send_or_die({ transport => $library->smtp_server->transport }); >- } >- catch { >- # We expect ref($_) eq 'Email::Sender::Failure' >- $error = $_->message; >- >- carp "$_"; >- return; >- }; >- >- return { error => $error } >- unless $success; >- } > > # If we come here, return an OK status > return 1; >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 78e3ac6d07..06adaab2b0 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -481,14 +481,29 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ > $newdata{emailaddr} = $emailaddr; > my $err; > eval { >- $err = SendAlerts ( 'members', \%newdata, "ACCTDETAILS" ); >+ my $letter = GetPreparedLetter( >+ module => 'members', >+ letter_code => 'ACCTDETAILS', >+ branchcode => $patron->branchcode,, >+ lang => $patron->lang || 'default', >+ tables => { >+ 'branches' => $patron->branchcode, >+ 'borrowers' => $patron->borrowernumber, >+ }, >+ want_librarian => 1, >+ ) or return; >+ >+ my $success = EnqueueLetter( >+ { >+ letter => $letter, >+ borrowernumber => $patron->id, >+ to_address => $emailaddr, >+ message_transport_type => 'email' >+ } >+ ); > }; >- if ( $@ ) { >- $template->param(error_alert => $@); >- } elsif ( ref($err) eq "HASH" && defined $err->{error} and $err->{error} eq "no_email" ) { >- $template->{VARS}->{'error_alert'} = "no_email"; >- } else { >- $template->{VARS}->{'info_alert'} = 1; >+ if ($@) { >+ $template->param( error_alert => $@ ); > } > } > } >-- >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 17648
:
131165
|
131199
|
131200
|
131202
|
131245
|
131403
|
131404
|
131405