Bug 26851 - Overdue notices should not send a report to the library if there is no content
Summary: Overdue notices should not send a report to the library if there is no content
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-28 18:58 UTC by Nick Clemens
Modified: 2021-02-11 22:22 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08


Attachments
Bug 26851: Don't generate a notice to library if no content (1.48 KB, patch)
2020-10-28 19:07 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26851: Don't generate a notice to library if no content (1.54 KB, patch)
2020-12-13 17:38 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 26851: Don't generate a notice to library if no content (1.61 KB, patch)
2021-01-11 12:29 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-10-28 18:58:02 UTC
The script checks if there is a letter when falling back to print, but it shoudl also check for the content of that letter
Comment 1 Nick Clemens 2020-10-28 19:07:08 UTC
Created attachment 112650 [details] [review]
Bug 26851: Don't generate a notice to library if no content

To test:
 1 - Check out an over due to a patron
 2 - Set overdue triggers to a trigger less than number of days overdue
 3 - Make sure the patron has no email
 4 - Set content of ODUE notice to:
    [%# Comment will not print %]
 5 - perl misc/cronjobs/overdue_notices.pl
 6 - Check the message queue
 7 - There is a notice sent to the library:
    "These messages were not sent directly to the patrons."
    With no messages
 8 - Apply patch
 9 - Repeat
10 - No new message generated
Comment 2 Victor Grousset/tuxayo 2020-12-13 17:38:53 UTC
Created attachment 114371 [details] [review]
Bug 26851: Don't generate a notice to library if no content

To test:
 1 - Check out an over due to a patron
 2 - Set overdue triggers to a trigger less than number of days overdue
 3 - Make sure the patron has no email
 4 - Set content of ODUE notice to:
    [%# Comment will not print %]
 5 - perl misc/cronjobs/overdue_notices.pl
 6 - Check the message queue
 7 - There is a notice sent to the library:
    "These messages were not sent directly to the patrons."
    With no messages
 8 - Apply patch
 9 - Repeat
10 - No new message generated

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 3 Victor Grousset/tuxayo 2020-12-13 17:40:56 UTC
It works :)

QA question, is that expected for a space char in the content to cause the message to be sent?
Comment 4 Nick Clemens 2020-12-15 13:44:40 UTC
(In reply to Victor Grousset/tuxayo from comment #3)
> It works :)
> 
> QA question, is that expected for a space char in the content to cause the
> message to be sent?

I would say yes, to allow the possibility that a library only wants the subject line sent.
Comment 5 Martin Renvoize 2021-01-11 12:25:15 UTC
I feel like we ought to be catching this in a few other places too.. this does indeed fix the issue for print notices for overdues.. but what about other print notice types?
Comment 6 Martin Renvoize 2021-01-11 12:29:30 UTC
Created attachment 115016 [details] [review]
Bug 26851: Don't generate a notice to library if no content

To test:
 1 - Check out an over due to a patron
 2 - Set overdue triggers to a trigger less than number of days overdue
 3 - Make sure the patron has no email
 4 - Set content of ODUE notice to:
    [%# Comment will not print %]
 5 - perl misc/cronjobs/overdue_notices.pl
 6 - Check the message queue
 7 - There is a notice sent to the library:
    "These messages were not sent directly to the patrons."
    With no messages
 8 - Apply patch
 9 - Repeat
10 - No new message generated

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2021-01-11 12:30:24 UTC
You can safely ignore my above comment..

This patch does as expected without regressions.. we could later followup to prevent other print notices ending up in the message queue I believe but that's for another day.

Passing QA
Comment 8 Jonathan Druart 2021-01-12 10:43:05 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-01-14 16:22:26 UTC
Pushed to 20.11.x for 20.11.02
Comment 10 Andrew Fuerste-Henry 2021-01-22 16:15:48 UTC
Pushed to 20.05.x for 20.05.08
Comment 11 Victor Grousset/tuxayo 2021-01-22 20:58:55 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.