hide deprecated values if empty after save
[ikiwiki.git] / IkiWiki / Plugin / lockedit.pm
index 033b3826347fce2ea83ad67b2a28e7d9ccc56260..4e1b4f8787249c3e17a4c97d77442ca8f0e9bd8d 100644 (file)
@@ -94,6 +94,9 @@ sub formbuilder_setup (@) { #{{{
                                IkiWiki::userinfo_set($user_name, "locked_pages",
                                        $form->field("locked_pages")) ||
                                                error("failed to set locked_pages");
                                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");
+                               }
                        }
                }
        }
                        }
                }
        }