Item11257: PublishPlugin keeps repeating index page after every topic in PDF mode

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: PublishPlugin
Branches:
Reported By: MarkCaveAyland
Waiting For:
Last Change By: CrawfordCurrie
-- MarkCaveAyland - 16 Nov 2011

 

It seems that the current version of the PublishPlugin will repeatedly publish the index.html page after every page when generating output in PDF mode.

After speaking to some developers on IRC, it transpires that the issue is that index.html is being added to the @files list once for each topic being published, and not just once for the entire document.

The provisional fix suggested by CDot was this:

--- PublishPlugin/file.pm.orig  2011-11-16 17:11:57.000000000 +0000
+++ PublishPlugin/file.pm       2011-11-16 17:13:38.000000000 +0000
@@ -79,7 +79,8 @@
         binmode($fh);
         print $fh $string;
         close($fh);
-        push( @{ $this->{files} }, $file );
+        push( @{ $this->{files} }, $file )
+            unless (grep { /^$file$/ } @{$this->{files}});
     }
     else {
         $this->{logger}->logError("Cannot write $file: $!");

This seems to work in my tests here and so it would be great if this fix could be applied to the current codebase. In terms of further development, it may also be useful to add an additional parameter for publishing which would suppress generation of the index file altogether since it has very limited use for non-HTML generation.

Kind regards,

Mark.
Closed some time ago.

-- CrawfordCurrie - 27 Jul 2012

ItemTemplate edit

Summary PublishPlugin keeps repeating index page after every topic in PDF mode
ReportedBy MarkCaveAyland
Codebase 1.1.3, 1.1.2, trunk
SVN Range
AppliesTo Extension
Component PublishPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r2 - 27 Jul 2012, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy