The logic in the script is: if ( ( scalar(@emails_to_use) == 0 || $nomail ) && $PrintNoticesMaxLines && $j >= $PrintNoticesMaxLines ) So if we don't pass 'nomail' and the patron has an email, the items don't get kicked out.
Created attachment 76044 [details] [review] Bug 20937: Truncate items for print notices when user has an email To test: 1 - Set PrintNotciesMaxLines to 1 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a notice 3 - Make sure the patron has an email 4 - Make sure the notice you are sending is set to 'print' as the type 5 - Run overdue_notices.pl without the 'nomail' option 6 - Find the message and note all items have been added 7 - Apply patch 8 - Clear the message queue 9 - Re-run overdue_notices.pl 10 - Confirm the message now has only 1 item.
Created attachment 83829 [details] [review] Bug 20937: Truncate items for print notices when user has an email To test: 1 - Set PrintNotciesMaxLines to 1 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a notice 3 - Make sure the patron has an email 4 - Make sure the notice you are sending is set to 'print' as the type 5 - Run overdue_notices.pl without the 'nomail' option 6 - Find the message and note all items have been added 7 - Apply patch 8 - Clear the message queue 9 - Re-run overdue_notices.pl 10 - Confirm the message now has only 1 item. Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Test plan made it easy to reproduce, patch works has expected
Comment on attachment 83829 [details] [review] Bug 20937: Truncate items for print notices when user has an email Review of attachment 83829 [details] [review]: ----------------------------------------------------------------- ::: misc/cronjobs/overdue_notices.pl @@ +683,4 @@ > # email or sms is requested but not exist, do a print. > $effective_mtt = 'print'; > } > + my @notice_items = @items; Why a new variable?
Created attachment 85790 [details] [review] Bug 20937: Truncate items for print notices when user has an email To test: 1 - Set PrintNoticesMaxLines to 1 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a notice 3 - Make sure the patron has an email 4 - Make sure the notice you are sending is set to 'print' as the type 5 - Run overdue_notices.pl without the 'nomail' option 6 - Find the message and note all items have been added 7 - Apply patch 8 - Clear the message queue 9 - Re-run overdue_notices.pl 10 - Confirm the message now has only 1 item. 11 - Set PrintNoticesMaxLines to 0 12 - Clear the message queue 13 - Re-run overdue_notices.pl 14 - Confirm the message has 2 items as expected
(In reply to Jonathan Druart from comment #4) > > Why a new variable? I wasn't sure if it was used elsewhere in the script - it does not appear to be, removed
Created attachment 87581 [details] [review] Bug 20937: Truncate items for print notices when user has an email To test: 1 - Set PrintNoticesMaxLines to 1 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a notice 3 - Make sure the patron has an email 4 - Make sure the notice you are sending is set to 'print' as the type 5 - Run overdue_notices.pl without the 'nomail' option 6 - Find the message and note all items have been added 7 - Apply patch 8 - Clear the message queue 9 - Re-run overdue_notices.pl 10 - Confirm the message now has only 1 item. 11 - Set PrintNoticesMaxLines to 0 12 - Clear the message queue 13 - Re-run overdue_notices.pl 14 - Confirm the message has 2 items as expected Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as intended, signing off.
Created attachment 87592 [details] [review] Bug 20937: Truncate items for print notices when user has an email To test: 1 - Set PrintNoticesMaxLines to 1 2 - Checkout 2 (or more) items to a patron and make them overdue to trigger a notice 3 - Make sure the patron has an email 4 - Make sure the notice you are sending is set to 'print' as the type 5 - Run overdue_notices.pl without the 'nomail' option 6 - Find the message and note all items have been added 7 - Apply patch 8 - Clear the message queue 9 - Re-run overdue_notices.pl 10 - Confirm the message now has only 1 item. 11 - Set PrintNoticesMaxLines to 0 12 - Clear the message queue 13 - Re-run overdue_notices.pl 14 - Confirm the message has 2 items as expected Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
Backported to 18.05.x for 18.05.12