Bugzilla – Attachment 44688 Details for
Bug 12923
Improve error logging for advance_notices.pl; Show borrowernumber when no letter of type is found and force utf8 output.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12923 Improve error logging for advance_notices.pl
Bug-12923-Improve-error-logging-for-advancenotices.patch (text/plain), 4.47 KB, created by
Frédéric Demians
on 2015-11-10 11:39:05 UTC
(
hide
)
Description:
Bug 12923 Improve error logging for advance_notices.pl
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2015-11-10 11:39:05 UTC
Size:
4.47 KB
patch
obsolete
>From 00a376f3f7f149f61d3c9f7f59bfe3f267ba765c Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Mon, 15 Sep 2014 11:42:34 +0300 >Subject: [PATCH] Bug 12923 Improve error logging for advance_notices.pl > >Show borrowernumber when no letter of type is found and force utf8 >output when running advance_notices.pl with -n flag, diacritics run awol >in the console output! > >Also when debugging which borrower requests undefined letter templates, >it is very handy to log the borrowernumber so we catch and fix bad >borrower message transport settings. > >TEST PREPARATION: > >0. Edit the ODUEDGST letter, find an undefined letter for any trasport > type. > >::TESTS ARE (ALMOST) THE SAME AS IN bugg 12922:: >TEST PLAN: > >1. Find a borrower and from the messaging preferences set the "Advance > notice" transport type to the undefined digest. Set the "Days in > Advance" to 1. >2. Check-out something for that borrower and set the due date for > tomorrow. >3. Run "misc/cronjobs/advance_notices.pl -c -n -v" from the terminal. >4. BEFORE THIS PATCH: You get an error "no letter of type 'PREDUEDGST' > found. Please see sample_notices.sql at ./advance_notices.pl line > 366." >4. AFTER THIS PATCH: You get an error "no letter of type 'PREDUEDGST' > found for borrowernumber 1104659. Please see sample_notices.sql at > ./advance_notices.pl line 368." > Makes life more worth living for! > Also diacritics printed on screen are displayed properly. > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > I confirm the diacritics issue and solution. borrowernumber is > displayed with warning when the 'no letter...' message is displayed. >--- > misc/cronjobs/advance_notices.pl | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index 16800f0..81c3cae 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -162,6 +162,8 @@ The F<misc/cronjobs/overdue_notices.pl> program allows you to send > messages to patrons when their messages are overdue. > =cut > >+binmode( STDOUT, ':encoding(UTF-8)' ); >+ > # These are defaults for command line options. > my $confirm; # -c: Confirm that the user has read and configured this script. > my $nomail; # -n: No mail. Will not send any emails. >@@ -266,7 +268,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > substitute => { 'items.content' => $titles }, > message_transport_type => $transport, > } ) >- or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ or warn "no letter of type '$letter_type' found for borrowernumber ".$upcoming->{'borrowernumber'}.". Please see sample_notices.sql"; > push @letters, $letter if $letter; > } > } >@@ -300,7 +302,7 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) { > substitute => { 'items.content' => $titles }, > message_transport_type => $transport, > } ) >- or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ or warn "no letter of type '$letter_type' found for borrowernumber ".$upcoming->{'borrowernumber'}.". Please see sample_notices.sql"; > push @letters, $letter if $letter; > } > } >@@ -373,7 +375,7 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) { > message_transport_type => $transport, > } > ) >- or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ or warn "no letter of type '$letter_type' found for borrowernumber $borrowernumber. Please see sample_notices.sql"; > push @letters, $letter if $letter; > } > >@@ -430,7 +432,7 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$due_digest ) { > message_transport_type => $transport, > } > ) >- or warn "no letter of type '$letter_type' found. Please see sample_notices.sql"; >+ or warn "no letter of type '$letter_type' found for borrowernumber $borrowernumber. Please see sample_notices.sql"; > push @letters, $letter if $letter; > } > >-- >2.6.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 12923
:
31615
|
34441
|
44688
|
45321