fix two recently introduced bugs in rename
authorJoey Hess <joey@kitenet.net>
Fri, 15 Jul 2011 22:46:16 +0000 (18:46 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 15 Jul 2011 22:46:16 +0000 (18:46 -0400)
* rename: Fix logic error that broke renaming pages when the attachment
  plugin was disabled.
* rename: Fix logic error that bypassed the usual pagespec checks.

IkiWiki/Plugin/rename.pm
debian/changelog

index aa108175667fce0e23493a45c14d3ec2542819b1..8e32d41aecfd58934fc7353612c680162abd2914 100644 (file)
@@ -184,7 +184,7 @@ sub rename_start ($$$$) {
        my $held=$attachment &&
                IkiWiki::Plugin::attachment->can("is_held_attachment") &&
                IkiWiki::Plugin::attachment::is_held_attachment($page);
        my $held=$attachment &&
                IkiWiki::Plugin::attachment->can("is_held_attachment") &&
                IkiWiki::Plugin::attachment::is_held_attachment($page);
-       if (! defined $held) {
+       if (! $held) {
                check_canrename($page, $pagesources{$page}, undef, undef,
                        $q, $session);
        }
                check_canrename($page, $pagesources{$page}, undef, undef,
                        $q, $session);
        }
@@ -322,7 +322,7 @@ sub sessioncgi ($$) {
                        my $held=$q->param("attachment") &&
                                IkiWiki::Plugin::attachment->can("is_held_attachment") &&
                                IkiWiki::Plugin::attachment::is_held_attachment($src);
                        my $held=$q->param("attachment") &&
                                IkiWiki::Plugin::attachment->can("is_held_attachment") &&
                                IkiWiki::Plugin::attachment::is_held_attachment($src);
-                       if (defined $held) {
+                       if ($held) {
                                rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest));
                                postrename($session, $src, $dest, $q->param("attachment"))
                                        unless defined $srcfile;
                                rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest));
                                postrename($session, $src, $dest, $q->param("attachment"))
                                        unless defined $srcfile;
index 8817d5b5ddd46b7332ba4ddb8c3a17a7b815e7da..253bb379db48cba5b19b92225316d313781d274b 100644 (file)
@@ -1,3 +1,11 @@
+ikiwiki (3.20110713) UNRELEASED; urgency=low
+
+  * rename: Fix logic error that broke renaming pages when the attachment
+    plugin was disabled.
+  * rename: Fix logic error that bypassed the usual pagespec checks.
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 15 Jul 2011 18:36:29 -0400
+
 ikiwiki (3.20110712) unstable; urgency=low
 
   * attachment: Bugfix to create directory when moving attachment out of 
 ikiwiki (3.20110712) unstable; urgency=low
 
   * attachment: Bugfix to create directory when moving attachment out of