From: Joey Hess Date: Fri, 1 Aug 2008 21:09:27 +0000 (-0400) Subject: hide deprecated values if empty after save X-Git-Url: https://scripts.mit.edu/gitweb/www/ikiwiki.git/commitdiff_plain/190a845fe1ab44d3947f2ecdc0305a180e21e6f2 hide deprecated values if empty after save --- diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index b6327f0c5..bd21ed1ed 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -143,6 +143,9 @@ sub formbuilder_setup (@) { #{{{ IkiWiki::userinfo_set($user_name, "allowed_attachments", $form->field("allowed_attachments")) || error("failed to set allowed_attachments"); + if (length $form->field("allowed_attachments")) { + $form->field(name => "allowed_attachments", type => "hidden"); + } } } } diff --git a/IkiWiki/Plugin/lockedit.pm b/IkiWiki/Plugin/lockedit.pm index 033b38263..4e1b4f878 100644 --- a/IkiWiki/Plugin/lockedit.pm +++ b/IkiWiki/Plugin/lockedit.pm @@ -94,6 +94,9 @@ sub formbuilder_setup (@) { #{{{ IkiWiki::userinfo_set($user_name, "locked_pages", $form->field("locked_pages")) || error("failed to set locked_pages"); + if (! length $form->field("locked_pages")) { + $form->field(name => "locked_pages", type => "hidden"); + } } } }