aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-08-02 23:14:59 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-08-02 23:14:59 -0400
commit8c02d670d010bbaa320b71435febc8d74e951749 (patch)
tree503b85ff09905d5f669162cb281c8c643562bc42
parentf6babf662b37f937048920127dfd0418482714f6 (diff)
downloadikiwiki-8c02d670d010bbaa320b71435febc8d74e951749.tar
ikiwiki-8c02d670d010bbaa320b71435febc8d74e951749.tar.gz
pull values from form to config
-rw-r--r--IkiWiki/Plugin/websetup.pm11
1 files changed, 10 insertions, 1 deletions
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");