X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/2e8d5c5adee8038440f935412888fb6dcf03ff6e..ceae681a438a044778df212642d5f174d8bbc182:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 5aa744c94..07319ad22 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -497,8 +497,11 @@ sub cgi_editpage ($$) { #{{{ else { # save page check_canedit($page, $q, $session); - if (! -e "$config{srcdir}/$file" && - $form->field("do") ne "create") { + + my $exists=-e "$config{srcdir}/$file"; + + if ($form->field("do") ne "create" && + ! $exists && ! -e "$config{underlaydir}/$file") { $form->tmpl_param("page_gone", 1); $form->field(name => "do", value => "create", force => 1); $form->tmpl_param("page_select", 0); @@ -509,8 +512,7 @@ sub cgi_editpage ($$) { #{{{ print misctemplate($form->title, $form->render(submit => \@buttons)); return; } - elsif (-e "$config{srcdir}/$file" && - $form->field("do") eq "create") { + elsif ($form->field("do") eq "create" && $exists) { $form->tmpl_param("creation_conflict", 1); $form->field(name => "do", value => "edit", force => 1); $form->tmpl_param("page_select", 0); @@ -557,7 +559,7 @@ sub cgi_editpage ($$) { #{{{ $message=$form->field('comments'); } - if ($form->field("do") eq "create") { + if (! $exists) { rcs_add($file); }