Bugzilla – Attachment 139391 Details for
Bug 31385
Additional contents: Allow searching a CMS page by code in multilanguage env
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31385: (follow-up) Switch to language param
Bug-31385-follow-up-Switch-to-language-param.patch (text/plain), 1.77 KB, created by
Nick Clemens (kidclamp)
on 2022-08-18 14:50:07 UTC
(
hide
)
Description:
Bug 31385: (follow-up) Switch to language param
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-08-18 14:50:07 UTC
Size:
1.77 KB
patch
obsolete
>From a3c0ab31399404770b465b3acf0b4e863ef103cb Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 17 Aug 2022 15:05:54 +0000 >Subject: [PATCH] Bug 31385: (follow-up) Switch to language param > >As Katrin suggested, we should use the language URL param instead. >If you pass code, we use the language cookie as fallback. >If that does not work, we look for default. > >Test plan: >Try former test plan but use code=X&language=Y. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > opac/opac-page.pl | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/opac/opac-page.pl b/opac/opac-page.pl >index 7fe0d88582..d5e83f7d4d 100755 >--- a/opac/opac-page.pl >+++ b/opac/opac-page.pl >@@ -19,7 +19,6 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Auth qw( get_template_and_user ); >-use C4::Languages qw(getlanguage); > use C4::Output qw( output_html_with_http_headers ); > use Koha::AdditionalContents; > >@@ -46,7 +45,7 @@ if (C4::Context->userenv) { > if( $page_id ) { > $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] }); > } elsif( $code ) { >- my $lang = $query->param('lang') || C4::Languages::getlanguage($query); # URL param overrides getlanguage >+ my $lang = $query->param('language') || $query->cookie('KohaOpacLanguage'); > # In the next query we make sure that the 'default' records come after the regular languages > $page = Koha::AdditionalContents->search({ code => $code, lang => ['default', $lang], location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] }, { order_by => { -desc => \[ 'CASE WHEN lang="default" THEN "" ELSE lang END' ]}} ); > } >-- >2.30.2
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 31385
:
139295
|
139296
|
139298
|
139348
|
139349
|
139390
| 139391 |
139392
|
139393