From 705655aff4a13f8efd84a6aeb1173c61d23d1a99 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. Signed-off-by: Jonathan Druart --- 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 6abc1b36d3..8105f97568 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.39.5