Item736: Comment plugin doesn't know about Compare Revisions

Priority: Normal
Current State: Closed
Released In: 1.0.1
Target Release: patch
Applies To: Extension
Component: CommentPlugin
Branches:
Reported By: TimotheLitt
Waiting For: Main.KennethLavrsen
Last Change By: KennethLavrsen
CommentPlugin incorrectly allows comment submission in a CompareRevisionsPlugin display.

Needs a better mechanism, but it's easy to extend the current kludge:

(Patch against TWiki, but foswiki code is identical)
--- lib/TWiki/Plugins/CommentPlugin.pm.4.2.3    2008-09-11 23:41:58.000000000 -0400
+++ lib/TWiki/Plugins/CommentPlugin.pm  2009-01-11 06:48:14.000000000 -0500
@@ -62,13 +62,13 @@
     return unless $_[0] =~ m/%COMMENT({.*?})?%/o;
     # SMELL: Nasty, tacky way to find out where we were invoked from
     my $scriptname = $ENV{'SCRIPT_NAME'} || '';
     # SMELL: unreliable
-    my $previewing = ($scriptname =~ /\/(preview|gnusave|rdiff)/);
+    my $previewing = ($scriptname =~ /\/(preview|gnusave|rdiff|compare)/);
     TWiki::Plugins::CommentPlugin::Comment::prompt( $previewing,
                                                     $_[0], $web, $topic );
 }
 sub beforeSaveHandler {
     #my ( $text, $topic, $web ) = @_;

-- TimotheLitt

Good catch

even if the code warns about nasty hacks etc it works for the other modes and why not make Comment aware of another important plugin

I will take this one when I am back in Denmark in 24 hours

-- KennethLavrsen - 11 Jan 2009

ItemTemplate edit

Summary Comment plugin doesn't know about Compare Revisions
ReportedBy TimotheLitt
Codebase 1.0.0
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component CommentPlugin
Priority Normal
CurrentState Closed
WaitingFor KennethLavrsen
Checkins distro:31788258408b
TargetRelease patch
ReleasedIn 1.0.1
Topic revision: r5 - 23 Feb 2009, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License