Bugzilla – Attachment 194442 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: Rename $lang in addbooks
acdca31.patch (text/plain), 2.07 KB, created by
Jonathan Druart
on 2026-03-04 11:28:34 UTC
(
hide
)
Description:
Bug 41989: Rename $lang in addbooks
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-03-04 11:28:34 UTC
Size:
2.07 KB
patch
obsolete
>From acdca314e67ba791ba6e1c9ea9dc91f24a677df7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Mar 2026 12:26:53 +0100 >Subject: [PATCH] Bug 41989: Rename $lang in addbooks > >I was navigating thought Koha and once I hit addbook the UI switched to French (my browser set Accept-Language en-GB,fr;q=0.9,es;q=0.8,en;q=0.7) > >I don't have the cookie lang. No idea what happened but I think the "$lang" variable in the controller might conflict with... a global $lang? > >It actually switched to French then Italian and German... >--- > cataloguing/addbooks.pl | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 9c8c3e4ffbf..5c3d48a8ffa 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( > { >@@ -60,12 +59,15 @@ if ($query) { > # build query > my @operands = $query; > >+ my $current_lang = C4::Languages::getlanguage($input); > my $builtquery; > my $query_cgi; > my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); > my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); >- ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) = >- $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang, { weighted_fields => 1 } ); >+ ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) = $builder->build_query_compat( >+ undef, \@operands, undef, undef, undef, 0, $current_lang, >+ { weighted_fields => 1 } >+ ); > > $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate'); > >-- >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