Question
I am having a problem where the editTablePlugin and publishWebPlugin get into a race condition. When you click save on the editTable, the server side will go into a spin condition repeatedly executing the following:
It seems that the TWiki::Func::expandCommonVariables causes the afterSaveHandler to run again. I put log statements, and it does not return from that call.
Symptoms: Debug ON for both PublishWebPlugin and EdtiTablePlugin
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: afterSaveHandler( CentennialBBC.ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: publishTopic( CentennialBBC, ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: publishTopic readTopicText( CentennialBBC, ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: publishTopic readTemplate( CentennialBBC, ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - EditTablePlugin::commonTagsHandler( CentennialBBC.ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: commonTagsHandler( CentennialBBC.ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - EditTablePlugin::commonTagsHandler( CentennialBBC.ConcessionSchedule )
| 08 Jan 2008 - 18:20 | - PublishWebPlugin: afterSaveHandler( CentennialBBC.ConcessionSchedule )
Code snipit with debug log statements shown:
sub publishTopic
{
my( $theWeb, $theTopic, $text ) = @_;
writeDebug( "publishTopic( $theWeb, $theTopic )" );
return unless( $theWeb eq $publishWeb );
return if( $theTopic =~ /$excludeTopic/ );
unless( $text ) {
$text = TWiki::Func::readTopicText( $theWeb, $theTopic );
}
writeDebug( "publishTopic readTopicText( $theWeb, $theTopic )" ); #RB
$text =~ s/%META:[A-Z0-9]+\{[^\n\r]+[\n\r]*//gs;
$text =~ s/.*?%STARTPUBLISH%//s;
$text =~ s/%STOPPUBLISH%.*//s;
my $tmpl = TWiki::Func::readTemplate( "view", $publishSkin );
writeDebug( "publishTopic readTemplate( $theWeb, $theTopic )" ); #RB
$tmpl =~ s/%META\{.*?\}%[\n\r]*//gs;
$tmpl =~ s/%TEXT%/$text/;
my $saveWeb = $web; $web = $theWeb;
my $saveTopic = $topic; $topic = $theTopic;
$tmpl = TWiki::Func::expandCommonVariables( $tmpl, $topic, $web );
writeDebug( "publishTopic expandCommonVariables( $theWeb, $theTopic )" ); #RB
It does not return from the expandCommonVariables call.
Environment
--
RichardBeaver - 09 Jan 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I have not tried to use the
EditTablePlugin with the
PublishWebPlugin. Why would you want to? A published page is for reading only.
--
PeterThoeny - 09 Jan 2008
I guess that my question does sound a little strange. Here is what I was trying to do:
- I have a TWiki setup where different high school booster clubs around my town can place their web sites (normally maybe a dozen or so pages) - for free.
- The booster clubs are frequently run by moms who can be easily intimidated by computers :-), so I tried to make it very easy for them to edit their information -- hence the use of editTable
- The web site started getting quite a lot of hits so I decided to install publishweb plugin to virtually eliminate my cpu usage (I am on a cheap hosting plan that clocks cpu usage in a 60 second rolling window).
- It works great. When they edit a page (using the TWiki side of the web site) it stores the static page at a more public location (which is actually pointed to by the school district web site).
- Then the problem with edittable/publish web surfaced. It gets stuck in a loop and my web site gets temporarily suspended due to too much cpu usage.
--
RichardBeaver - 10 Jan 2008
For this type of work you might want to look into different
Extensions:chaching
, such as the
PublicCacheAddOn. The
PublishWebPlugin is specifically designed to easily maintain a static website in a wiki, e.g. not to cache wiki content.
--
PeterThoeny - 02 Mar 2008