diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-02 02:57:45 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-05-02 02:57:45 +0000 |
commit | e7f97eae6071601aec4d7843f94f6fcb4b45657e (patch) | |
tree | d348eb55e4b9d29297e3aef8b51cdf36ec4e52ee /IkiWiki | |
parent | a7dd176e48052735268e6a30013a2613e511fb14 (diff) | |
download | ikiwiki-e7f97eae6071601aec4d7843f94f6fcb4b45657e.tar ikiwiki-e7f97eae6071601aec4d7843f94f6fcb4b45657e.tar.gz |
* Smarter behavior when creating a page and a page of the same name (but
different location) already exists.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/CGI.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index e5cee9cb9..92d042dc9 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -360,13 +360,6 @@ sub cgi_editpage ($$) { #{{{ if (! $form->submitted || $form->submitted eq "Preview" || ! $form->validate) { if ($form->field("do") eq "create") { - if (exists $pagesources{lc($page)}) { - # hmm, someone else made the page in the - # meantime? - print $q->redirect("$config{url}/".htmlpage($page)); - return; - } - my @page_locs; my $best_loc; my ($from)=$form->param('from')=~/$config{wiki_file_regexp}/; @@ -395,13 +388,20 @@ sub cgi_editpage ($$) { #{{{ $dir=~s![^/]+/+$!!; push @page_locs, $dir.$page; } - - @page_locs = grep { - ! exists $pagesources{lc($_)} && - ! page_locked($_, $session, 1) - } @page_locs; } + @page_locs = grep { + ! exists $pagesources{lc($_)} && + ! page_locked($_, $session, 1) + } @page_locs; + + if (! @page_locs) { + # hmm, someone else made the page in the + # meantime? + print $q->redirect("$config{url}/".htmlpage($page)); + return; + } + $form->tmpl_param("page_select", 1); $form->field(name => "page", type => 'select', options => \@page_locs, value => $best_loc); |