X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Finstall.pl;h=063832569c8ef33489d36a63a5890a0fa1eae30c;hb=7f4536c715a2165874a3ef3ae70a2d5baeff2a0f;hp=3d410f34cb55d648bff64e1fd0f79772bc22b84d;hpb=312c5f16d8bb0d8c58bd6deb1350a47ba526cb77;p=koha-ffzg.git diff --git a/installer/install.pl b/installer/install.pl index 3d410f34cb..063832569c 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -54,7 +54,7 @@ if ( defined($language) ) { my $installer = C4::Installer->new(); my %info; -$info{'dbname'} = C4::Context->config("database"); +$info{'dbname'} = C4::Context->config("database_test") || C4::Context->config("database"); $info{'dbms'} = ( C4::Context->config("db_scheme") ? C4::Context->config("db_scheme") @@ -416,10 +416,12 @@ elsif ( $step && $step == 3 ) { or die "Cannot open log file $logfilepath_errors: $!"; @report = <$fh>; close $fh; + my $update_errors; if (@report) { $template->param( update_errors => [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] ); + $update_errors = 1; $template->param( has_update_errors => 1 ); warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; @@ -429,12 +431,22 @@ elsif ( $step && $step == 3 ) { eval { `rm $logfilepath_errors` }; } - my $db_entries = get_db_entries(); - my $report = update( $db_entries ); - - $template->param( success => $report->{success}, error => $report->{error} ); + unless ( $update_errors ) { + my $db_entries = get_db_entries(); + my $report = update( $db_entries ); + my $atomic_update_files = get_atomic_updates; + my $atomic_update_report = run_atomic_updates( $atomic_update_files ); + + $template->param( + success => $report->{success}, + error => $report->{error}, + atomic_updates => { + success => $atomic_update_report->{success}, + error => $atomic_update_report->{error} + } + ); + } - #warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n"; #FIXME restore this $template->param( $op => 1 ); } else {