diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-02-14 15:42:14 -0500 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-02-14 15:42:14 -0500 |
commit | 553136ec1f73246cde1dce300b15eec2e5e73a97 (patch) | |
tree | b0486bb9ec44037ec0b6b8ca2d9b6f7ea52690de /IkiWiki/CGI.pm | |
parent | 8be2b60aaca495b84c299cf69ee8958603bd7204 (diff) | |
download | ikiwiki-553136ec1f73246cde1dce300b15eec2e5e73a97.tar ikiwiki-553136ec1f73246cde1dce300b15eec2e5e73a97.tar.gz |
* Preview limits the page dropdown to what's selected previously
(as preserving the full list across preview would be tricky). Userdirs
were still being offered as an option there, remove them.
* Fix a bug where user A created a page concurrently with user B, and
when B previewed it would redirect B to A's new page, losing B's work.
Instead, don't redirect and let conflict handling resolve it.
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r-- | IkiWiki/CGI.pm | 17 |
1 files changed, 13 insertions, 4 deletions
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 { |