Tags:
create new tag
view all tags

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. smile

Environment

TWiki version: TWikiAlphaRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Gentoo Linux
Web server: Apache 2.0.49
Perl version: 5.8.2
Client OS:  
Web Browser:  

-- 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

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2004-06-02 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.