* Allow editing a page and deleting all content, while still disallowing
authorJoey Hess <joey@kitenet.net>
Thu, 13 Dec 2007 00:11:29 +0000 (19:11 -0500)
committerJoey Hess <joey@kitenet.net>
Thu, 13 Dec 2007 00:11:29 +0000 (19:11 -0500)
  creating a new page that's entirely empty.

IkiWiki/CGI.pm
debian/changelog
doc/bugs/Can__39__t_deplete_page__63__.mdwn

index 33e670eacbd7291b6cd1a30092b33f9b80e6bd93..c2dacf78d46253a74015cd67155bbb33fc34ad70 100644 (file)
@@ -310,9 +310,6 @@ sub cgi_editpage ($$) { #{{{
                fields => \@fields,
                charset => "utf-8",
                method => 'POST',
-               validate => {
-                       editcontent => '/.+/',
-               },
                required => [qw{editcontent}],
                javascript => 0,
                params => $q,
@@ -356,6 +353,7 @@ sub cgi_editpage ($$) { #{{{
                        $form->field(name => "rcsinfo",
                                value => rcs_prepedit($file), force => 1);
                }
+               $form->field(name => "editcontent", validate => '/.*/');
        }
        else {
                $type=$form->param('type');
@@ -371,6 +369,7 @@ sub cgi_editpage ($$) { #{{{
                if (! $form->submitted) {
                        $form->field(name => "rcsinfo", value => "", force => 1);
                }
+               $form->field(name => "editcontent", validate => '/.+/');
        }
 
        $form->field(name => "do", type => 'hidden');
index 091c3622f03ab5ef87fde7d253235630875f0ab4..7533ae99cddb1d9e8e432aa0cefc5dca68e35b4b 100644 (file)
@@ -36,6 +36,8 @@ ikiwiki (2.16) UNRELEASED; urgency=low
   * Use a div in the note template rather than a span.
   * shortcut: Expand %S to the raw input text, not url-encoded.
   * Don't increment feed numbers when an inline has no feeds. (Nis Martensen)
+  * Allow editing a page and deleting all content, while still disallowing
+    creating a new page that's entirely empty.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 03 Dec 2007 14:47:36 -0500
 
index cfa51cf481e0e5823c6c1c0de83d4bca130ad839..5ae034e9981aaa7a3651bf8d0a299d92dcf1f8fb 100644 (file)
@@ -4,3 +4,5 @@ On web-editing I erased all the text, entered a change notice and selected
 *Save Page*.
 I was, however, thrown back to the web-editing frame, with the old text in it
 restored, instead of the page being cleared.
+
+>> [[done]] --[[Joey]]