From 8c02d670d010bbaa320b71435febc8d74e951749 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 2 Aug 2008 23:14:59 -0400 Subject: [PATCH] pull values from form to config --- IkiWiki/Plugin/websetup.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 64c4d0991..24ccee40f 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -261,7 +261,16 @@ sub showform ($$) { #{{{ foreach my $field (keys %fields) { # TODO plugin enable/disable next if $field=~/^enable\./; # plugin - $config{$fields{$field}}=$form->field($field); + + my $key=$fields{$field}; + my $value=$form->field($field); + + next unless defined $value; + # Avoid setting fields to empty strings, + # if they were not set before. + next if ! defined $config{$key} && ! length $value; + + $config{$key}=$value; } # TODO save to real path IkiWiki::Setup::dump("/tmp/s"); -- 2.26.2