Question
I have a topic (Main.WebHome) that generates a nastygram when I click the "History" link.
The message reads "Undefined subroutine &TWiki::handleIncludeFile called".
The site is using a slightly modified version of PatternSkin,
in case this might be relevant.
Looking in /var/log/httpd/*, I found messages in error_log:
error_log:[Wed Dec 20 12:09:14 2006] [error] [client 1.2.3.4]
Undefined subroutine &TWiki::handleIncludeFile called at
/www/twiki-4.0.5/lib/TWiki/Plugins/DefaultPlugin.pm line 150.,
referer:
http://my.decru.com/bin/view/Main
The code in question is in the commonTagsHandler subroutine:
...
# This is the place to define customized tags and variables
# Called by TWiki::handleCommonTags, after %INCLUDE:"..."%
# for compatibility for earlier TWiki versions:
if( $doOldInclude ) {
# allow two level includes
$_[0] =~ s/%INCLUDE:"([^%\"]*?)"%/TWiki::handleIncludeFile(
$1, $_[1], $_[2], "" )/geo; <<<
$_[0] =~ s/%INCLUDE:"([^%\"]*?)"%/TWiki::handleIncludeFile(
$1, $_[1], $_[2], "" )/geo;
}
...
Grepping for handleIncludeFile in /lib/TWiki/Plugins only found
the lines given above. My suspicion is that this is an obscure
TWiki bug which we have (somehow) exercised by using INCLUDE files.
Given that we aren't running an "earlier TWiki version", I decided
to simply turn off this "feature".
$doOldInclude is set (in DefaultPlugin.pm) by:
$doOldInclude = TWiki::Func::getPluginPreferencesFlag(
"OLDINCLUDE" ) || "";
Looking around in the TWiki, I saw that TWiki.DefaultPlugin
was setting OLDINCLUDE:
Set OLDINCLUDE = 1
So, I added the line:
Set OLDINCLUDE = 0
and the problem went away. Given that the flag was causing a
non-existent function to be called, I can't imagine that this
change will hurt anything.
Environment
--
RichMorin - 20 Dec 2006
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.
You might have a version mismatch between
DefaultPlugin and TWiki. Disable the plugin if you do not need it. In any case it is unlikely that you need the OLDINCLUDE, this is from a very ancient TWiki.
--
PeterThoeny - 24 Dec 2006