From 5b2ab63f7873b27229a5617d0c208a526b25cd2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Dec 2007 19:11:29 -0500 Subject: * Allow editing a page and deleting all content, while still disallowing creating a new page that's entirely empty. --- IkiWiki/CGI.pm | 5 ++--- debian/changelog | 2 ++ doc/bugs/Can__39__t_deplete_page__63__.mdwn | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 33e670eac..c2dacf78d 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -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'); diff --git a/debian/changelog b/debian/changelog index 091c3622f..7533ae99c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 03 Dec 2007 14:47:36 -0500 diff --git a/doc/bugs/Can__39__t_deplete_page__63__.mdwn b/doc/bugs/Can__39__t_deplete_page__63__.mdwn index cfa51cf48..5ae034e99 100644 --- a/doc/bugs/Can__39__t_deplete_page__63__.mdwn +++ b/doc/bugs/Can__39__t_deplete_page__63__.mdwn @@ -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]] -- cgit v1.2.3