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")
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";
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 {