]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DBUpgrade2.pm
DATEV-Check für nur eine Buchung
[mfinanz.git] / SL / DBUpgrade2.pm
index 86ae9fdee41ed75548aa7f1ace83ff59b6dcb4e4..6de1fd258426dd19eeac498e15394b8557f3b419 100644 (file)
@@ -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<depends> will be applied
 before the current one is applied.
 
 =item charset
+
 =item encoding
 
 The charset this file uses. Defaults to C<ISO-8859-15> if