• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item3689: CommentPlugin location only works if it is above the %COMMENT... tag

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension CommentPlugin Normal Closed   minor 4.1.3, 4.2.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

If you use the location to specify where to place the comment, it will only match if its above the comment tag. Otherwise, it seems to match itself, and the output is placed above the comment tag.

-- TWiki:Main/AndrewJones86 - 27 Feb 2007

Heh; nasty. I can imagine that might happen. Do you have a testcase, please? Use LitterTray web.

CC

Have created a test case here: Item3689Test

Cheers.

-- TWiki:Main.AndrewJones86 - 27 Feb 2007

Yep. That is confirmed.

-- KennethLavrsen - 27 Feb 2007


I have fixed this for my local install. Maybe you can patch the release. All I have done is modified the regex to skip lines starting with a % sign (i.e. %COMMENT..).

The code is below, starting at line 250 in lib/TWiki/Plugins/CommentPlugin/Comment.pm

            if ( $position eq 'BEFORE' ) {
                $text =~ s/^[^\%]($location)/$output$1/m;
            } else { # AFTER
                $text =~ s/^[^\%]($location)/$1$output/m;
            }

Obviously, if people decide to use the start of line in location, then this will break it. But its a quick fix anyway.

-- TWiki:Main.AndrewJones86 - 01 Mar 2007

It would be an easy check to see if location=" is not just before the match.

-- TWiki:Main.ArthurClemens - 10 Apr 2007

Done.

-- TWiki:Main.ArthurClemens - 10 Apr 2007

Also fixed a warning in locations, highlighted while unit testing.

CC

ItemTemplate
Summary CommentPlugin location only works if it is above the %COMMENT... tag
ReportedBy TWiki:Main.AndrewJones86
Codebase 4.1.0
SVN Range

AppliesTo Extension
Component CommentPlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:13353 TWikirev:13354 TWikirev:13702
TargetRelease minor
ReleasedIn 4.1.3, 4.2.0
Edit | Attach | Watch | Print version | History: r17 < r16 < r15 < r14 < r13 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r17 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback