create new tag
, view all tags

Bug: Recursive includes seems to be broken

I had to apply following patch to fix them:

Index: TWiki.pm
RCS file: /var/cvs/iponweb/twiki-full/lib/TWiki.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TWiki.pm    2003/02/26 14:53:20     1.3
+++ TWiki.pm    2003/04/08 15:10:14     1.4
@@ -1412,7 +1412,7 @@
     # FIXME What about attachments?

     # recursively process multiple embedded %INCLUDE% statements and prefs
-    $text =~ s/%INCLUDE{(.*?)}%/&handleIncludeFile($1, $theTopic, $theWeb, @theProcessedTopics )/ge;
+    $text =~ s/%INCLUDE{(.*?)}%/&handleIncludeFile($1, $theTopic, $theWeb, $verbatim, @theProcessedTopics )/ge;

     return $text;

Without this patch I get

Can't use string ("/SOME/PATH") as an ARRAY ref
while "strict refs" in use at ../lib/TWiki.pm line 1881.


Note that the line number probably doesn't match sources in released version as we did some modifications in our installation of TWiki. This line corresponds to line

my $verbatimCount = $#{$verbatim} + 1;

from TWiki::takeOutVerbatim().

Test case


TWiki version: TWiki20030201 with some local modifications
TWiki plugins: N/A
Server OS: Linux Debian
Web server: Apache 1.3.9
Perl version: 5.6.1
Client OS: Any
Web Browser: Any

-- IlyaMartynov - 08 Apr 2003

Follow up

This is indeed a bug. (but error message does not show up on TWiki.org)

-- PeterThoeny - 09 Apr 2003

Fix record

As usual, I have packaged your patch as a ready-to-apply patch.

Peter, what would be nice would be a page listing all the "maintenance patches" to apply to the stable versions in operations, for people not wanting to risk damaging a working TWiki in production (and not wanting to spend the amount of work necessary to do a version upgrade)?

-- ColasNahaboo - 09 Apr 2003

Fix is now in TWikiAlphaRelease and at TWiki.org.

Listing maintenance patches: Yes, that makes sense as part of the WebFormReorg, possibly with a new MaintenancePatchFor form field listing all production releases.

BTW, the patch has one extra comma that should go away.

-- PeterThoeny - 11 Apr 2003

Oops, sorry. Fixed and re-uploaded as v2

-- ColasNahaboo - 12 Apr 2003

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch RecursiveIncludesSeemsToBeBroken.patch r2 r1 manage 0.6 K 2003-04-12 - 15:13 ColasNahaboo patch to lib/TWiki.pm, Feb 2003 release, v2
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2003-04-12 - ColasNahaboo
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.