Bug 21249: New syspref controlling branch fields queried against selected library...
[srvgit] / installer / install.pl
index ecc2530..be6ee27 100755 (executable)
@@ -33,7 +33,7 @@ use C4::Installer::PerlModules;
 
 use Koha;
 
-my $query = new CGI;
+my $query = CGI->new;
 my $step  = $query->param('step');
 
 my $language = $query->param('language');
@@ -49,7 +49,6 @@ if ( defined($language) ) {
         template_name => "installer/step" . ( $step ? $step : 1 ) . ".tt",
         query         => $query,
         type          => "intranet",
-        authnotrequired => 0,
         debug           => 1,
     }
 );
@@ -221,9 +220,10 @@ elsif ( $step && $step == 3 ) {
 
     my $op = $query->param('op');
     if ( $op && $op eq 'finished' ) {
-        #
+        # Remove the HandleError set at the beginning of the installer process
+        C4::Context->dbh->disconnect;
+
         # we have finished, just redirect to mainpage.
-        #
         print $query->redirect("/cgi-bin/koha/mainpage.pl");
         exit;
     }
@@ -245,9 +245,12 @@ elsif ( $step && $step == 3 ) {
     elsif ( $op && $op eq 'addframeworks' ) {
 
         # 1ST install, 3rd sub-step : insert the SQL files the user has selected
+        my $langchoice = $query->param('fwklanguage');
+        $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
+        $langchoice =~ s/[^a-zA-Z_-]*//g;
 
         my ( $fwk_language, $list ) =
-          $installer->load_sql_in_order( $all_languages,
+          $installer->load_sql_in_order( $langchoice, $all_languages,
             $query->multi_param('framework') );
         $template->param(
             "fwklanguage" => $fwk_language,
@@ -403,7 +406,7 @@ elsif ( $step && $step == 3 ) {
         close $fh;
         if (@report) {
             $template->param( update_report =>
-                  [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ]
+                  [ map { { line => $_ =~ s/\t/  /gr } } split( /\n/, join( '', @report ) ) ]
             );
             $template->param( has_update_succeeds => 1 );
         }