Item10594: not all addToHEAD() content is being output
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
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
-
PublishPlugin::Publisher::publishTopic()
calls PublishPlugin::PageAssembler::assemblePage()
-
assemblePage()
calls _renderZones()
-
PublishPlugin::Publisher::publishTopic()
calls Foswiki::Func::renderText()
.
- 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!
--
CrawfordCurrie - 25 May 2011