Bug 12923 - Improve error logging for advance_notices.pl; Show borrowernumber when no letter of type is found and force utf8 output.
Summary: Improve error logging for advance_notices.pl; Show borrowernumber when no let...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-15 15:17 UTC by Olli-Antti Kivilahti
Modified: 2017-06-14 22:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12923 - Improve error logging for advance_notices.pl; Show borrowernumber when no letter of type is found and force utf8 output. (3.17 KB, patch)
2014-09-15 15:18 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 12923 - Improve error logging for advance_notices.pl; Show borrowernumber when no letter of type is found and force utf8 output. (4.32 KB, patch)
2014-12-15 16:16 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 12923 Improve error logging for advance_notices.pl (4.47 KB, patch)
2015-11-10 11:39 UTC, Frédéric Demians
Details | Diff | Splinter Review
Bug 12923 Improve error logging for advance_notices.pl (4.55 KB, patch)
2015-12-02 12:08 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2014-09-15 15:17:48 UTC
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.

This patch fixes those issues.
Comment 1 Olli-Antti Kivilahti 2014-09-15 15:18:55 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2014-11-25 16:03:41 UTC
Olli, Is this ready to be tested?
Please provide a test plan.
Comment 3 Olli-Antti Kivilahti 2014-12-15 16:16:41 UTC Comment hidden (obsolete)
Comment 4 Olli-Antti Kivilahti 2014-12-15 16:17:39 UTC
Having this in production for 3+ months already.
Let me know of any bugs ;)
Comment 5 Frédéric Demians 2015-11-10 11:39:05 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-12-02 12:07:50 UTC
Everything works fine but I am wondering if it couldn't be useful to display the branchcode too.
A letter is not generated because it's missing for a given branchcode (here the one from the issue), not for a given patron.
Comment 7 Jonathan Druart 2015-12-02 12:08:23 UTC
Created attachment 45321 [details] [review]
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.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Kyle M Hall (khall) 2015-12-31 16:12:30 UTC
Pushed to master, thanks Olli!
Comment 9 Olli-Antti Kivilahti 2016-02-08 14:13:35 UTC
Happy new year to you too!