From: Moritz Bunkus Date: Mon, 6 May 2013 10:05:18 +0000 (+0200) Subject: $::form nach Perl-Upgrade-Script-Ausführung resetten X-Git-Tag: release-3.1.0beta1~417^2~6 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8f7283f501b3ddc2809d073b5d0399d20ed5af06;p=kivitendo-erp.git $::form nach Perl-Upgrade-Script-Ausführung resetten Siehe 87eebe6 für Begründung. --- diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index d98627c56..c9bf7aba5 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 @@ -272,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(); }