summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-10-11 11:27:06 -0400
committerJoey Hess <joey@kitenet.net>2010-10-11 11:41:34 -0400
commitcfbd272c8bdbb96b6e92449f4d940fb2b72aa651 (patch)
treeceb12f800d61a05f44e45428b013fd4dd9fdcfc8
parent274219ecc865f9bdcb65ad26e4750fa90dfaa670 (diff)
websetup: Fix defaults of checkboxes in advanced mode.
So formbuilder has an annoying glitch, that setting the value of a checkbox, even without force, will override the value currently on the form. Thus the guards against changing checkbox values when a form has been submitted. But those guards also prevented the checkboxes for advanced items getting the right value when going into advanced mode. Note that if the user makes changes to advanced mode stuff and leaves advanced mode, those changes are lost. That seems reasonable so I didn't change it -- and it made this fix simple.
-rw-r--r--IkiWiki/Plugin/websetup.pm3
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm
index 2674b91e8..0ab18997c 100644
--- a/IkiWiki/Plugin/websetup.pm
+++ b/IkiWiki/Plugin/websetup.pm
@@ -219,7 +219,8 @@ sub showfields ($$$@) {
options => [ [ 1 => $description ] ],
fieldset => $section,
);
- if (! $form->submitted) {
+ if (! $form->submitted ||
+ ($info{advanced} && $form->submitted eq 'Advanced Mode')) {
$form->field(name => $name, value => $value);
}
}
diff --git a/debian/changelog b/debian/changelog
index fb012abd2..6d333a843 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ ikiwiki (3.20100927) UNRELEASED; urgency=low
feature.
* actiontabs: More consistent styling of Hn tags.
* websetup: Fix saving of advanced mode changes.
+ * websetup: Fix defaults of checkboxes in advanced mode.
-- Joey Hess <joeyh@debian.org> Wed, 29 Sep 2010 11:58:23 -0400