hide deprecated values if empty after save

master
Joey Hess 2008-08-01 17:09:27 -04:00
parent 4a5793729b
commit 190a845fe1
2 changed files with 6 additions and 0 deletions

View File

@ -143,6 +143,9 @@ sub formbuilder_setup (@) { #{{{
IkiWiki::userinfo_set($user_name, "allowed_attachments", IkiWiki::userinfo_set($user_name, "allowed_attachments",
$form->field("allowed_attachments")) || $form->field("allowed_attachments")) ||
error("failed to set allowed_attachments"); error("failed to set allowed_attachments");
if (length $form->field("allowed_attachments")) {
$form->field(name => "allowed_attachments", type => "hidden");
}
} }
} }
} }

View File

@ -94,6 +94,9 @@ sub formbuilder_setup (@) { #{{{
IkiWiki::userinfo_set($user_name, "locked_pages", IkiWiki::userinfo_set($user_name, "locked_pages",
$form->field("locked_pages")) || $form->field("locked_pages")) ||
error("failed to set locked_pages"); error("failed to set locked_pages");
if (! length $form->field("locked_pages")) {
$form->field(name => "locked_pages", type => "hidden");
}
} }
} }
} }