From 190a845fe1ab44d3947f2ecdc0305a180e21e6f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 Aug 2008 17:09:27 -0400 Subject: hide deprecated values if empty after save --- IkiWiki/Plugin/attachment.pm | 3 +++ IkiWiki/Plugin/lockedit.pm | 3 +++ 2 files changed, 6 insertions(+) (limited to 'IkiWiki') 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"); + } } } } -- cgit v1.2.3