From dda6392c303a6822197af1993c5b3bf14f288d14 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 Jun 2021 11:57:00 +0200 Subject: [PATCH] Bug 28514: Set lang to default is not passed It fixes the following test: # Failed test 'no lang passed, default is returned' # at t/db_dependent/Koha/Notices.t line 105. # got: 'es-ES' # expected: 'default' # Looks like you failed 1 test of 7. --- Koha/Notice/Templates.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Notice/Templates.pm b/Koha/Notice/Templates.pm index 6abc1b36d34..8105f975680 100644 --- a/Koha/Notice/Templates.pm +++ b/Koha/Notice/Templates.pm @@ -59,7 +59,9 @@ sub find_effective_template { my ( $self, $params ) = @_; $params = { %$params }; # don't modify original - $params->{lang} = 'default' unless C4::Context->preference('TranslateNotices'); + + $params->{lang} = 'default' + unless C4::Context->preference('TranslateNotices') && $params->{lang}; my $only_my_library = C4::Context->only_my_library; if ( $only_my_library and $params->{branchcode} ) { -- 2.20.1