Bugzilla – Attachment 194642 Details for
Bug 41989
addbook shows the translated interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41989: Call getlanguage after get_template_and_user
292dad8.patch (text/plain), 1.68 KB, created by
Jonathan Druart
on 2026-03-06 11:08:10 UTC
(
hide
)
Description:
Bug 41989: Call getlanguage after get_template_and_user
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-03-06 11:08:10 UTC
Size:
1.68 KB
patch
obsolete
>From 292dad8943138d507b034929a29d5c3b0522f7d3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 6 Mar 2026 12:04:32 +0100 >Subject: [PATCH] Bug 41989: Call getlanguage after get_template_and_user > >This patch prevents the UI to randomly change the language when reaching >addbooks > >The problem is that getlanguage is called BEFORE get_template_and_user, >without, and "interface" (C4::Context->interface) is not set yet. > >Open C4/Languages.pm, search "sub getlanguage" >We first read the cache, then if there is no interface we reach >GetTranslatedLanguages that does return languages in a random order, >then we pick the first one >765 @languages = map { $_->{rfc4646_subtag} } @{ getTranslatedLanguages( $interface, $theme ) }; >783 $language = shift @languages unless $language; > >We must call getlanguage AFTER that the cache is populated. >--- > cataloguing/addbooks.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 9c8c3e4ffbf..4a3bcd1a295 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -43,7 +43,6 @@ my $query = $input->param('q'); > my @value = $input->multi_param('value'); > my $page = $input->param('page') || 1; > my $results_per_page = 20; >-my $lang = C4::Languages::getlanguage($input); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -53,6 +52,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > flagsrequired => { editcatalogue => '*' }, > } > ); >+my $lang = C4::Languages::getlanguage($input); > > # Searching the catalog. > if ($query) { >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41989
:
194442
| 194642