From a4573184230ce89257b17533fafae05bfbd490d9 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 9 Aug 2018 17:46:09 +0000 Subject: [PATCH] Bug 20504: Fix lang attribute in html tag on systempreferences page On the system preferences page the lang attribute of the html tag is always empty. To test: - Go to systempreferences - Check the html source and look at the html tag, it should read: - Apply patch - Check the html source again: Verify the language code shown matches the currently selected language in the staff interface - Verify the language system preferences work correctly Signed-off-by: Jonathan Druart The problem was actually that $lang = $template->param( 'lang' ); should certainly be $lang = $input->param( 'lang' ); and, as it, it overrides the value of 'lang' passed from C4::Auth Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens (cherry picked from commit 56c50a66169f956584050a8630a71cfa7d5984cb) Signed-off-by: Martin Renvoize (cherry picked from commit 32b01b264277a77dbb79133f5af8eeecbe64d997) Signed-off-by: Fridolin Somers --- admin/preferences.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/admin/preferences.pl b/admin/preferences.pl index 8a4778154b..4719815d8e 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -35,7 +35,6 @@ use YAML::Syck qw(); use List::MoreUtils qw(any); $YAML::Syck::ImplicitTyping = 1; $YAML::Syck::ImplicitUnicode = 1; -our $lang; # use Smart::Comments; # @@ -81,7 +80,7 @@ sub _get_chunk { $interface = 'intranet'; $theme = C4::Context->preference('template'); } - $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, $lang, $current_languages ); + $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages ); $chunk->{'type'} = 'languages'; } elsif ( $options{ 'choices' } ) { if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) { @@ -306,7 +305,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -$lang = $template->param( 'lang' ); my $op = $input->param( 'op' ) || ''; my $tab = $input->param( 'tab' ); $tab ||= 'acquisitions'; # Ideally this should be "local-use" but preferences.pl -- 2.39.5