Question
Hellow, all. I am attempting to create a plugin that automatically runs the
PublishAddOn, but having a couple of problems.
TWiki runs and saves fine without the plugin installed, but as soon as I place my
PublishPlugins.pm file in my lib/TWiki/Plugins directory, I get an error 500 just after the preview stage, and I have the following error in my apache logs:
malformed header from script. Bad header= _________________________: save, referer: http://user.theoretic.com/bin/preview/Theo/Music
and here is the one subroutine I have defined in my plugin (other than the initPlugin):
sub afterSaveHandler
{
### my ( $text, $topic, $web, $error ) = @_; # do not uncomment, use $_[0], $_[1]... instead
TWiki::Func::writeDebug( "- ${pluginName}::afterSaveHandler( $_[2].$_[1] )" ) if $debug;
system "lynx -dump http://www.theoretic.com/bin/publish/$_[2]?goAhead=yes" || die;
# This handler is called by TWiki::Store::saveTopic just after the save action.
# New hook in TWiki::Plugins $VERSION = '1.020'
}
I know, it's a really ugly hack, and that may have something to do with it, but until I find an
alternative, better way, that's what I've done. Unfortunately, I can't seem to get any extra debug info from apache2 (even with
LogLevel set to debug) and the Plugin (with the topic's DEBUG set to 1). Hopefully someone has come accross this before when making Plugins, and knows what the problem is, thanks.
Environment
--
AdamTheo - 11 Apr 2004
It's been a while since this was asked, and you may have wandered off, but if I were you I'd try running the plugin script from the command line; something like this:
perl -I ../../../.. AdamsPlugin.pm
and watch what happens. If that doesn't help, pepper the code with "print STDERR" statements - these will get printed to the apache
error_log allowing you to trace what's happening.
--
CrawfordCurrie - 17 May 2004
Answer