return ($module, $submodule);
}
+@dont_save = qw(login password stylesheet action);
+
sub save {
$main::lxdebug->enter_sub();
my ($self, $myconfig, $form, $draft_id, $draft_description) = @_;
- my ($dbh, $sth, $query, %saved, @dont_save, $dumped);
+ my ($dbh, $sth, $query, %saved, $dumped);
$dbh = $form->dbconnect_noauto($myconfig);
do_query($form, $dbh, $query, $draft_id, $module, $submodule);
}
- @dont_save = qw(login password action);
map({ $saved{$_} = $form->{$_};
delete($form->{$_}); } @dont_save);
if ($old_form) {
$old_form = YAML::Load($old_form);
- @{$form}{keys %{ $old_form } } = @{$old_form}{keys %{ $old_form } };
+ my %dont_save_vars = map { $_ => 1 } @Drafts::dont_save;
+ my @restore_vars = grep { !$skip_vars{$_} } keys %{ $old_form };
+
+ @{$form}{@restore_vars} = @{$old_form}{@restore_vars};
$form->{draft_id} = $id;
$form->{draft_description} = $description;