]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
websetup: Fix defaults of checkboxes in advanced mode.
authorJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 05:55:11 +0000 (01:55 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 05:55:11 +0000 (01:55 -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.
(cherry picked from commit cfbd272c8bdbb96b6e92449f4d940fb2b72aa651)

Conflicts:

debian/changelog

IkiWiki/Plugin/websetup.pm
debian/changelog

index 2674b91e812a3eb8b98edcdb12026d067f34b112..0ab18997c860d90a2841064a0ffc536f195fd21a 100644 (file)
@@ -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);
                        }
                }
index 4f0eda9d70559c0c222c71c47dea33fcb258e2e6..e36f0285b7f1eaedbf80515ebdec88db2eec07ed 100644 (file)
@@ -8,6 +8,7 @@ ikiwiki (3.20100815.2) UNRELEASED; urgency=low
     for strings that contained only a number, fixing a longstanding crash
     of the rst plugin.
   * websetup: Fix saving of advanced mode changes.
+  * websetup: Fix defaults of checkboxes in advanced mode.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 15 Aug 2010 11:42:55 -0400