Previously overdue_notices use exclusively the default language but bug 26420 changed this to the opposite, which is to use exclusively the language chosen by the user. But if no translation have been provided for the chosen language, no message is sent. I would expect the behavior to be the same as in GetPreparedLetter: $letter = getletter( $module, $letter_code, $branchcode, $mtt, $lang ); unless ( $letter ) { $letter = getletter( $module, $letter_code, $branchcode, $mtt, 'default' ) or warn( "No $module $letter_code letter transported by " . $mtt ), return; }
I think this sounds like a major bug - a lot of libraries might only define the default notice in their "main" language. That's the expected behaviour and the described change could be bad trouble espeially as overdues are a sensitive area.
Created attachment 121580 [details] [review] Bug 28487: Remove getletter
This patch goes way to far but it's the goal we want to reach to prevent future regressions like that. I will try and see if I can come up with a simpler fix.
Created attachment 121627 [details] [review] Bug 28487: Fallback to default template in overdue_notices There is no fallback to the "default" language if there is no language-specific template for the lang of the patron. I am not really sure why we are not using GetPreparredLetter here (which defaults), but this needs to be backported into all stable branches and so as small as possible.
Andreas, can you test this patch please?
Could we get a test plan for this, and I will happily attempt to test 8-).
Hi David, Test plan: Hi David, Hi David, - Make sure you have TranslateNotices turned on - Set a default lang for a given patron - Have some overdue rules and translate notice templates - Generate overdues for the patron - Run the overdue_notices.pl script => The translated notice templates is picked - Remove the translated notice templates for the lang of the patron - Run the overdue_notices.pl script => Without this patch no notice is generated => With this patch a notice is generated using the default notice template.
(In reply to Jonathan Druart from comment #7) Thanks Jonathan! For some reason I couldn't get notices to generate for overdue items I created, so will leave for someone else more familiar with this to test.
Created attachment 121726 [details] [review] Bug 28487: Fallback to default template in overdue_notices There is no fallback to the "default" language if there is no language-specific template for the lang of the patron. I am not really sure why we are not using GetPreparredLetter here (which defaults), but this needs to be backported into all stable branches and so as small as possible. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Code reads well, testing proves it works as expected.. Signing off.
Thanks Martin!
Created attachment 121853 [details] [review] Bug 28487: Fallback to default template in overdue_notices There is no fallback to the "default" language if there is no language-specific template for the lang of the patron. I am not really sure why we are not using GetPreparredLetter here (which defaults), but this needs to be backported into all stable branches and so as small as possible. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.01
Pushed to 20.11.x for 20.11.07
Backported: Pushed to 20.05.x branch for 20.05.13
Should this be backported to 19.11.x? For 19.11.19?
Should this be backported to 19.11.x? For 19.11.20?
(In reply to wainuiwitikapark from comment #18) > Should this be backported to 19.11.x? For 19.11.20? Yes, I think so.
Backported to 19.11.x for 19.11.20
Just found another instance of the issue while printing fine related slips: bug 28712