Bug 26420 - Overdue notices script does not care about borrower's language, always takes default template
Summary: Overdue notices script does not care about borrower's language, always takes ...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 28487
  Show dependency treegraph
 
Reported: 2020-09-09 15:47 UTC by Sophie MEYNIEUX
Modified: 2022-12-12 21:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05, 19.11.11, 19.05.16


Attachments
Bug 26420: Use translated notices for overdue_notices.pl (2.20 KB, patch)
2020-09-10 08:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26420: Use translated notices for overdue_notices.pl (2.26 KB, patch)
2020-09-14 10:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 26420: Use translated notices for overdue_notices.pl (2.32 KB, patch)
2020-09-15 20:01 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sophie MEYNIEUX 2020-09-09 15:47:11 UTC
Since Bug 17762, it is possible to translate notices.
But script misc/cronjobs/overdue_notices.pl does not test if preference system is active and does not call C4::Letters::getletter with $lang parameter

So if preference system is active and default template not filled because you want translated notices, their is no notice generated at all.
Comment 1 Jonathan Druart 2020-09-10 08:41:03 UTC
Created attachment 109837 [details] [review]
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
Comment 2 Martin Renvoize 2020-09-14 10:09:04 UTC
Created attachment 110036 [details] [review]
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 <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2020-09-14 10:09:36 UTC
Works as expected, Signing off
Comment 4 Katrin Fischer 2020-09-15 20:01:48 UTC
Created attachment 110123 [details] [review]
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 <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-09-18 09:54:15 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass 2020-10-15 21:52:21 UTC
backported to 20.05.x for 20.05.05
Comment 7 Aleisha Amohia 2020-10-20 01:52:01 UTC
backported to 19.11.x for 19.11.11
Comment 8 Victor Grousset/tuxayo 2020-10-20 20:48:17 UTC
Backported to 19.05.x branch for 19.05.16
Comment 9 Andreas Jonsson 2021-05-28 15:20:29 UTC
Shouldn't we still fall back to the default language if a tranlation is missing? I reported bug 28487.
Comment 10 Katrin Fischer 2021-05-29 13:54:12 UTC
(In reply to Andreas Jonsson from comment #9)
> Shouldn't we still fall back to the default language if a tranlation is
> missing? I reported bug 28487.

I think you are correct.