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.
Created attachment 31615 [details] [review] Bug 12923 - Improve error logging for advance_notices.pl; Show borrowernumber when no letter of type is found and force utf8 output.
Olli, Is this ready to be tested? Please provide a test plan.
Created attachment 34441 [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. This patch fixes those issues. 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.
Having this in production for 3+ months already. Let me know of any bugs ;)
Created attachment 44688 [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.
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.
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>
Pushed to master, thanks Olli!
Happy new year to you too!