View | Details | Raw Unified | Return to bug 24872
Collapse All | Expand All

(-)a/C4/Installer.pm (+26 lines)
Lines 447-452 sub set_version_syspref { Link Here
447
    C4::Context->clear_syspref_cache();
447
    C4::Context->clear_syspref_cache();
448
}
448
}
449
449
450
=head2 set_languages_syspref
451
452
  $installer->set_languages_syspref();
453
454
Add the installation language to 'language' and 'opaclanguages' system preferences
455
if different from 'en'
456
457
=cut
458
459
sub set_languages_syspref {
460
    my $self     = shift;
461
    my $language = shift;
462
463
    return if ( not $language or $language eq 'en' );
464
465
    warn "UPDATE Languages";
466
    # intranet
467
    my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'");
468
    $pref->execute("en,$language");
469
    # opac
470
    $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='opaclanguages'");
471
    $pref->execute("en,$language");
472
473
    C4::Context->clear_syspref_cache();
474
}
475
450
=head2 load_sql
476
=head2 load_sql
451
477
452
  my $error = $installer->load_sql($filename);
478
  my $error = $installer->load_sql($filename);
(-)a/installer/install.pl (-1 / +5 lines)
Lines 230-235 elsif ( $step && $step == 3 ) { Link Here
230
    elsif ( $op && $op eq 'finish' ) {
230
    elsif ( $op && $op eq 'finish' ) {
231
        $installer->set_version_syspref();
231
        $installer->set_version_syspref();
232
232
233
        my $langchoice = $query->param('fwklanguage');
234
        $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
235
        $langchoice =~ s/[^a-zA-Z_-]*//g;
236
        $installer->set_languages_syspref($langchoice);
237
233
# Installation is finished.
238
# Installation is finished.
234
# We just deny anybody access to install
239
# We just deny anybody access to install
235
# And we redirect people to mainpage.
240
# And we redirect people to mainpage.
236
- 

Return to bug 24872