X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a3f224cb6cf82b89cf0cbadbd661fd5d71ebf8ae..81081787458a907d023d55939f6e7568a52a0f27:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 4d4464c28..cfb2c0b1d 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -394,9 +394,10 @@ sub cgi_editpage ($$) { #{{{ $dir=~s![^/]+/+$!!; push @page_locs, $dir.$page; } + + push @page_locs, "$config{userdir}/$page" + if length $config{userdir}; } - push @page_locs, "$config{userdir}/$page" - if length $config{userdir}; @page_locs = grep { ! exists $pagecase{lc $_} @@ -404,8 +405,16 @@ sub cgi_editpage ($$) { #{{{ if (! @page_locs) { # hmm, someone else made the page in the # meantime? - redirect($q, "$config{url}/".htmlpage($page)); - return; + if ($form->submitted eq "Preview") { + # let them go ahead with the edit + # and resolve the conflict at save + # time + @page_locs=$page; + } + else { + redirect($q, "$config{url}/".htmlpage($page)); + return; + } } my @editable_locs = grep {