]> sipb.mit.edu Git - ikiwiki.git/commitdiff
websetup: Fix defaults of checkboxes in advanced mode.
authorJoey Hess <joey@kitenet.net>
Mon, 11 Oct 2010 15:27:06 +0000 (11:27 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 11 Oct 2010 15:41:34 +0000 (11:41 -0400)
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.

IkiWiki/Plugin/websetup.pm
debian/changelog

index 2674b91e812a3eb8b98edcdb12026d067f34b112..0ab18997c860d90a2841064a0ffc536f195fd21a 100644 (file)
@@ -219,7 +219,8 @@ sub showfields ($$$@) {
                                options => [ [ 1 => $description ] ],
                                fieldset => $section,
                        );
                                options => [ [ 1 => $description ] ],
                                fieldset => $section,
                        );
-                       if (! $form->submitted) {
+                       if (! $form->submitted ||
+                           ($info{advanced} && $form->submitted eq 'Advanced Mode')) {
                                $form->field(name => $name, value => $value);
                        }
                }
                                $form->field(name => $name, value => $value);
                        }
                }
index fb012abd24bd636071c50a04685dbf9e738fda8e..6d333a8438fbff96ad106d53fd611480b00798f0 100644 (file)
@@ -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.
     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
 
 
  -- Joey Hess <joeyh@debian.org>  Wed, 29 Sep 2010 11:58:23 -0400