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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-10-28 19:00:28 +00:00 committed by Jonathan Druart
parent c055685ac4
commit 9769160083

View file

@ -731,7 +731,7 @@ END_SQL
message_transport_type => $letter_exists ? $effective_mtt : $mtt,
}
);
unless ($letter) {
unless ($letter && $letter->{content}) {
$verbose and warn qq|Message '$overdue_rules->{"letter$i"}' content not found|;
# this transport doesn't have a configured notice, so try another
next;