X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/347f2cff58f8d798bb0fe52495fb09b4e08db036..7635f647ec7dcdef51684b21601ee0930ea2bc5b:/SL/DBUpgrade2.pm diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index 86ae9fdee..6de1fd258 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -242,6 +242,8 @@ sub process_perl_script { my ($self, $dbh, $filename, $version_or_control, $db_charset) = @_; + my %form_values = map { $_ => $::form->{$_} } qw(dbconnect dbdefault dbdriver dbhost dbmbkiviunstable dbname dboptions dbpasswd dbport dbupdate dbuser login template_object version); + $dbh->begin_work; # setup dbup_ export vars & run script @@ -250,13 +252,11 @@ sub process_perl_script { file_name => $filename, tag => $version_or_control->{tag}, dbh => $dbh, - locale => $::locale, myconfig => \%dbup_myconfig, ); - if (1 != $result) { + if (1 != ($result // 1)) { $dbh->rollback(); - $dbh->disconnect(); } if (!defined($result)) { @@ -274,6 +274,13 @@ sub process_perl_script { } $dbh->commit(); + # Clear $::form of values that may have been set so that following + # Perl upgrade scripts won't have to work with old data (think of + # the usual 'continued' mechanism that's used for determining + # whether or not the upgrade form must be displayed). + delete @{ $::form }{ keys %{ $::form } }; + $::form->{$_} = $form_values{$_} for keys %form_values; + $::lxdebug->leave_sub(); } @@ -542,6 +549,7 @@ depends on. All other upgrades listed in C will be applied before the current one is applied. =item charset + =item encoding The charset this file uses. Defaults to C if