From e89aa3f62b67153d0939fc99675294aa423d04e7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 10 Sep 2020 09:42:58 +0200 Subject: [PATCH] Bug 26420: Use translated notices for overdue_notices.pl This script does not pass the patron's preferred lang for notices. Test plan: Enable TranslateNotices Create a patron with a preferred lang for notices != default Translate ODUE for this language Setup the overdue notices for this patron's category Check an item out for this patron (select the correct due date to trigger the notice) Run the script overdue_notices.pl Check the message_queue table and confirm that the notice enqueued is translated Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart (cherry picked from commit 8e397330f687bd0e9e39387e32a8a8acbbb3b31a) Signed-off-by: Lucas Gass (cherry picked from commit eb88ec34bffb57554f31e7b56cd40b37aaa08e6b) Signed-off-by: Aleisha Amohia (cherry picked from commit 0dfcff4c8f6759e5f280e90c0a9c5e4944d3c62f) Signed-off-by: Victor Grousset/tuxayo --- misc/cronjobs/overdue_notices.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index a4348fed24..8440f3a3ba 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -596,7 +596,7 @@ END_SQL } } - my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode ); + my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode, undef, $patron->lang ); unless ($letter) { $verbose and warn qq|Message '$overdue_rules->{"letter$i"}' content not found|; @@ -687,7 +687,7 @@ END_SQL splice @items, $PrintNoticesMaxLines if $effective_mtt eq 'print' && $PrintNoticesMaxLines && scalar @items > $PrintNoticesMaxLines; #catch the case where we are sending a print to someone with an email - my $letter_exists = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode, $effective_mtt ) ? 1 : 0; + my $letter_exists = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"}, $branchcode, $effective_mtt, $patron->lang ) ? 1 : 0; my $letter = parse_overdues_letter( { letter_code => $overdue_rules->{"letter$i"}, borrowernumber => $borrowernumber, -- 2.39.5