Skip to content

Commit

Permalink
Item11331: preRenderingHandler gets called more than once
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@13308 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Dec 5, 2011
1 parent 854b92d commit 1f29b05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ our $initialised;
my $DEFAULT_TABLE_SETTINGS =
'tableborder="1" valign="top" headercolor="#000000" headerbg="#d6d3cf" headerbgsorted="#c4c1ba" databg="#ffffff,#edf4f9" databgsorted="#f1f7fc,#ddebf6" tablerules="rows" headerrules="cols"';
my $styles = {}; # hash to keep track of web->topic
my $readyForHandler;
our $writtenToHead = 0;

sub initPlugin {
Expand Down Expand Up @@ -63,7 +64,10 @@ sub preRenderingHandler {

# on-demand inclusion
require Foswiki::Plugins::TablePlugin::Core;
Foswiki::Plugins::TablePlugin::Core::_init();
if ( !$readyForHandler ) {
Foswiki::Plugins::TablePlugin::Core::_init();
$readyForHandler = 1;
}
Foswiki::Plugins::TablePlugin::Core::handler(@_);
}

Expand Down

0 comments on commit 1f29b05

Please sign in to comment.