From c260666f53b243aef7d4d7f71e2caf2999d1b2fa Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 31 Aug 2007 06:33:33 +0000 Subject: [PATCH] =?utf8?q?Bei=20den=20Entw=C3=BCrfen=20nicht=20die=20Varia?= =?utf8?q?ble=20"stylesheet"=20speichern.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Drafts.pm | 5 +++-- bin/mozilla/drafts.pl | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SL/Drafts.pm b/SL/Drafts.pm index 96d4d913e..44088994b 100644 --- a/SL/Drafts.pm +++ b/SL/Drafts.pm @@ -34,12 +34,14 @@ sub get_module { 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); @@ -54,7 +56,6 @@ sub save { do_query($form, $dbh, $query, $draft_id, $module, $submodule); } - @dont_save = qw(login password action); map({ $saved{$_} = $form->{$_}; delete($form->{$_}); } @dont_save); diff --git a/bin/mozilla/drafts.pl b/bin/mozilla/drafts.pl index 1aa34a56f..dbe61ffda 100644 --- a/bin/mozilla/drafts.pl +++ b/bin/mozilla/drafts.pl @@ -103,7 +103,10 @@ sub load_draft { 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; -- 2.20.1