Bugzilla – Attachment 13127 Details for
Bug 8954
Languages list in advanced search always in english
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch 2
0001-Bug-8954-Languages-list-in-advanced-search-always-in.patch (text/plain), 3.27 KB, created by
Fridolin Somers
on 2012-10-31 08:24:42 UTC
(
hide
)
Description:
Proposed patch 2
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-10-31 08:24:42 UTC
Size:
3.27 KB
patch
obsolete
>From 722cfdccac38c1ecb63506cfe1f7d1c5f63a64c0 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 31 Oct 2012 09:21:39 +0100 >Subject: [PATCH] Bug 8954: Languages list in advanced search always in > english > >--- > C4/Languages.pm | 6 +++++- > catalogue/search.pl | 5 ++--- > opac/opac-search.pl | 5 ++--- > 3 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/C4/Languages.pm b/C4/Languages.pm >index d0eed69..b289a3d 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -179,9 +179,13 @@ Returns a reference to an array of hashes: > =cut > > sub getAllLanguages { >+ my $lang = shift; > my @languages_loop; > my $dbh=C4::Context->dbh; >- my $current_language = shift || 'en'; >+ my $current_language = 'en'; >+ if ($lang) { >+ $current_language = lc(substr($lang, 0, 2)); >+ } > my $sth = $dbh->prepare('SELECT * FROM language_subtag_registry WHERE type=\'language\''); > $sth->execute(); > while (my $language_subtag_registry = $sth->fetchrow_hashref) { >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 8b1234b..d1a3ca2 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -158,7 +158,7 @@ use CGI qw('-no_undef_params'); > my $cgi = new CGI; > > my ($template,$borrowernumber,$cookie); >- >+my $lang = C4::Templates::getlanguage($cgi, 'intranet'); > # decide which template to use > my $template_name; > my $template_type; >@@ -334,7 +334,7 @@ if ( $template_type eq 'advsearch' ) { > search_boxes_loop => \@search_boxes_array); > > # load the language limits (for search) >- my $languages_limit_loop = getAllLanguages(); >+ my $languages_limit_loop = getAllLanguages($lang); > $template->param(search_languages_loop => $languages_limit_loop,); > > # Expanded search options in advanced search: >@@ -472,7 +472,6 @@ my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit > my @results; > > ## I. BUILD THE QUERY >-my $lang = C4::Templates::getlanguage($cgi, 'intranet'); > ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang); > > ## parse the query_cgi string and put it into a form suitable for <input>s >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 7677d86..73d2c53 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -71,7 +71,7 @@ BEGIN { > } > > my ($template,$borrowernumber,$cookie); >- >+my $lang = C4::Templates::getlanguage($cgi, 'opac'); > # decide which template to use > my $template_name; > my $template_type = 'basic'; >@@ -178,7 +178,7 @@ $template->param( > ); > > # load the language limits (for search) >-my $languages_limit_loop = getAllLanguages(); >+my $languages_limit_loop = getAllLanguages($lang); > $template->param(search_languages_loop => $languages_limit_loop,); > > # load the Type stuff >@@ -418,7 +418,6 @@ my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_ > my @results; > > ## I. BUILD THE QUERY >-my $lang = C4::Templates::getlanguage($cgi, 'opac'); > ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang); > > sub _input_cgi_parse { >-- >1.7.9.5 >
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 8954
:
12997
|
13127
|
13332
|
13371
|
13502
|
13558
|
13860