fix two recently introduced bugs in rename

* rename: Fix logic error that broke renaming pages when the attachment
  plugin was disabled.
* rename: Fix logic error that bypassed the usual pagespec checks.
master
Joey Hess 2011-07-15 18:46:16 -04:00
parent 87db6fbb79
commit 4cd2efef8c
2 changed files with 10 additions and 2 deletions

View File

@ -184,7 +184,7 @@ sub rename_start ($$$$) {
my $held=$attachment && my $held=$attachment &&
IkiWiki::Plugin::attachment->can("is_held_attachment") && IkiWiki::Plugin::attachment->can("is_held_attachment") &&
IkiWiki::Plugin::attachment::is_held_attachment($page); IkiWiki::Plugin::attachment::is_held_attachment($page);
if (! defined $held) { if (! $held) {
check_canrename($page, $pagesources{$page}, undef, undef, check_canrename($page, $pagesources{$page}, undef, undef,
$q, $session); $q, $session);
} }
@ -322,7 +322,7 @@ sub sessioncgi ($$) {
my $held=$q->param("attachment") && my $held=$q->param("attachment") &&
IkiWiki::Plugin::attachment->can("is_held_attachment") && IkiWiki::Plugin::attachment->can("is_held_attachment") &&
IkiWiki::Plugin::attachment::is_held_attachment($src); IkiWiki::Plugin::attachment::is_held_attachment($src);
if (defined $held) { if ($held) {
rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest)); rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest));
postrename($session, $src, $dest, $q->param("attachment")) postrename($session, $src, $dest, $q->param("attachment"))
unless defined $srcfile; unless defined $srcfile;

8
debian/changelog vendored
View 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 ikiwiki (3.20110712) unstable; urgency=low
* attachment: Bugfix to create directory when moving attachment out of * attachment: Bugfix to create directory when moving attachment out of