* Preview limits the page dropdown to what's selected previously
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 14 Feb 2008 20:42:14 +0000 (15:42 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 14 Feb 2008 20:42:14 +0000 (15:42 -0500)
  (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.

IkiWiki/CGI.pm
debian/changelog
doc/bugs/Preview_removes_page_location_drop-down_options.mdwn

index 4d4464c2872a48c32b331c88cfe4a35c9349a1fc..cfb2c0b1d8e39447581d0fb16606c8ff3fac7243 100644 (file)
@@ -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 {
index d56c132adf73a44c1b40271b9dc6b155efa325cc..02d6aa499fb5a928717cc732535f2f49a826f68d 100644 (file)
@@ -27,6 +27,12 @@ ikiwiki (2.40) UNRELEASED; urgency=low
     containing ikiwiki.cgi, but this should not change the urls to the style
     sheets etc. Add a new forcebareurl parameter to misctemplate to allow
     it to do that.
+  * 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.
 
  -- Josh Triplett <josh@freedesktop.org>  Sun, 10 Feb 2008 13:18:58 -0800
 
index e314f1f0effe98c7b65bdf422b97921eb09ec04b..71b3c7147d985a9d15cba18ab3d8a23220a8b5c1 100644 (file)
@@ -3,3 +3,8 @@ If there is more than one option in the Page Location drop down box when create
 The problem exists on Ikiwiki's wiki, but manifests itself differently, in that subpages are still displayed, so maybe that's the actual bug :)
 
 Anyway, to reproduce, edit any page, view the page location options, preview, and some will disappear.
+
+> Yeah, this is a dark corner. :-) It'd be nice if preview did preserve the
+> lise, but it's complex to do so. So for now the bug is that it added
+> userdirs to the list, which I've fixed, so calling this [[done]]
+> --[[Joey]]