From 5c0f539950540544a44756a04efcb3663993789d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Aug 2008 14:41:53 -0400 Subject: [PATCH] avoid adding extra disabled fields for arrays --- IkiWiki/Plugin/websetup.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index d087b4863..bfc238dc3 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -110,14 +110,15 @@ sub showfields ($$$@) { #{{{ } } - my $value=$config{$key}; - if (ref $config{$key} eq 'ARRAY' || ref $info{example} eq 'ARRAY') { - push @{$value}, "", ""; # blank items for expansion - } - # multiple plugins can have the same field my $name=defined $plugin ? $plugin.".".$key : $key; + my $value=$config{$key}; + + if ($info{safe} && (ref $config{$key} eq 'ARRAY' || ref $info{example} eq 'ARRAY')) { + push @{$value}, "", ""; # blank items for expansion + } + if ($info{type} eq "string") { $form->field( name => $name,