X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/04b2a4d6762b33a199b18de4df3991ecba87db7d..4fe1538b4df838f73382ed64648aa7c12c7ef50a:/IkiWiki/Plugin/remove.pm diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 5e5b83349..14ac01c9b 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -119,10 +119,16 @@ sub removal_confirm ($$@) { my @pages=@_; # Special case for unsaved attachments. - @pages=grep { - ! (IkiWiki::Plugin::attachment->can("remove_held_attachment") && - IkiWiki::Plugin::attachment::remove_held_attachment($_)) - } @pages; + foreach my $page (@pages) { + if ($attachment && IkiWiki::Plugin::attachment->can("is_held_attachment")) { + my $f=IkiWiki::Plugin::attachment::is_held_attachment($page); + if (defined $f) { + require IkiWiki::Render; + IkiWiki::prune($f); + } + } + } + @pages=grep { exists $pagesources{$_} } @pages; return unless @pages; foreach my $page (@pages) {