Item10594: not all addToHEAD() content is being output

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: PublishPlugin
Branches:
Reported By: DiabJerius
Waiting For:
Last Change By: CrawfordCurrie
Version 2.20

I noticed this first with the TablePlugin, but other parts of the system are also affected. Some of the content passed to addToHEAD is not getting output. Here's an example in what I'm seeing in the generated HTML:

<!--TABLEPLUGIN_specific: requires= missing ids: TABLEPLUGIN_default-->
<!--JavascriptFiles/foswikiPref: requires= missing ids: JQUERYPLUGIN::FOSWIKI-->
<!--JavascriptFiles/foswikiString: requires= missing ids: JQUERYPLUGIN::FOSWIKI-->
<!--JSCalendarContrib/foswiki-->
<!--JavascriptFiles/foswikiForm: requires= missing ids: JQUERYPLUGIN::FOSWIKI-->
<!--JSCalendarContrib/calendar-->
<!--JSCalendarContrib/calendar-lang-->
<!--PatternSkin/pattern: requires= missing ids: JQUERYPLUGIN::FOSWIKI-->

Everything looks fine in the standard rendering.

-- DiabJerius - 04 Apr 2011

Further poking at this for a specific topic

  1. PublishPlugin::Publisher::publishTopic() calls PublishPlugin::PageAssembler::assemblePage()
  2. assemblePage() calls _renderZones()
  3. PublishPlugin::Publisher::publishTopic() calls Foswiki::Func::renderText().
    1. the TablePlugin calls addToHEAD. Too Late!

I'm still not sure why the TABLEPLUGIN_specific content sometimes ends up in the output; the above sequence implies it shouldn't.

-- DiabJerius - 04 Apr 2011

I've attached a preliminary patch which calls renderText() before _renderZones(). This produces correct output (so far as I have tested, which is minimal) when publishing a single topic.

When publishing multiple topics TablePlugin and JQueryPlugin are not writing out all of their zone contents; this is presumably because they're trying to be efficient.

-- DiabJerius - 04 Apr 2011

Belay that last comment about TablePlugin & JQueryPlugin.

JQueryPlugin, loads its zone content in initPlugin. Unfortunately, when _renderZones is called, it deletes all zone content. Hence, for all of the remaining topics the zones are devoid of the JQueryPlugin content.

I've amended the patch to save the JQueryPlugin content across calls to _renderZones. It's a real kludge.

-- DiabJerius - 05 Apr 2011

I merged your patch, but only checked that nothing broke (I didn't check if it works). See how much I trust you! wink

-- CrawfordCurrie - 25 May 2011

 

ItemTemplate edit

Summary not all addToHEAD() content is being output
ReportedBy DiabJerius
Codebase 1.1.2
SVN Range
AppliesTo Extension
Component PublishPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins PublishPlugin:8631c133c75d
TargetRelease n/a
ReleasedIn n/a
I Attachment Action Size Date Who Comment
renderzone.patchpatch renderzone.patch manage 2 K 05 Apr 2011 - 18:41 DiabJerius  
Topic revision: r7 - 25 May 2011, 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