Bugzilla – Attachment 101522 Details for
Bug 24872
Set languages system preferences after web install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24872: Set languages prefererences after install
Bug-24872-Set-languages-prefererences-after-instal.patch (text/plain), 2.41 KB, created by
Jonathan Druart
on 2020-03-24 09:22:09 UTC
(
hide
)
Description:
Bug 24872: Set languages prefererences after install
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-24 09:22:09 UTC
Size:
2.41 KB
patch
obsolete
>From 9c3db499ddeed4d0178e005a975913a1a3237224 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Sun, 15 Mar 2020 11:39:42 -0300 >Subject: [PATCH] Bug 24872: Set languages prefererences after install > >This patch set 'languages' and 'opaclanguages' system >preferences with the language used during install. > >To test: >1. Apply the patch >2. Do a clean install in a language other than english >3. Verify that 'languages' and 'opaclanguages' system >preferences show the language code used during install, >besides english. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Installer.pm | 26 ++++++++++++++++++++++++++ > installer/install.pl | 5 +++++ > 2 files changed, 31 insertions(+) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 5f343f5ffe..7dd4f42095 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -447,6 +447,32 @@ sub set_version_syspref { > C4::Context->clear_syspref_cache(); > } > >+=head2 set_languages_syspref >+ >+ $installer->set_languages_syspref(); >+ >+Add the installation language to 'language' and 'opaclanguages' system preferences >+if different from 'en' >+ >+=cut >+ >+sub set_languages_syspref { >+ my $self = shift; >+ my $language = shift; >+ >+ return if ( not $language or $language eq 'en' ); >+ >+ warn "UPDATE Languages"; >+ # intranet >+ my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'"); >+ $pref->execute("en,$language"); >+ # opac >+ $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='opaclanguages'"); >+ $pref->execute("en,$language"); >+ >+ C4::Context->clear_syspref_cache(); >+} >+ > =head2 load_sql > > my $error = $installer->load_sql($filename); >diff --git a/installer/install.pl b/installer/install.pl >index 851accb319..ecc2530297 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -230,6 +230,11 @@ elsif ( $step && $step == 3 ) { > elsif ( $op && $op eq 'finish' ) { > $installer->set_version_syspref(); > >+ my $langchoice = $query->param('fwklanguage'); >+ $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); >+ $langchoice =~ s/[^a-zA-Z_-]*//g; >+ $installer->set_languages_syspref($langchoice); >+ > # Installation is finished. > # We just deny anybody access to install > # And we redirect people to mainpage. >-- >2.20.1
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 24872
:
100712
|
101446
| 101522