We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Bug: View raw=on is broken, shows raw=debug

The raw=on view shows now the debug view, it should show just the raw topic text without the meta data. This is a new bug of latest TWikiBetaRelease2004x07x29.

Test case

Environment

TWiki version: TWikiBetaRelease2004x07x29
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, etc
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- PeterThoeny - 30 Jul 2004

Fix record

This fix is now in SVN and TWiki.org. Removed the scheduled for Cairo since it was introduced recently.

This bug was caused by the following line in TWiki::UI::View, which was introduced recently to escape percent signs in raw text:

       $text =~ s/%/&\#037\;/go;

Unified diff:

--- bu4/View.pm Sat Jul 10 01:15:22 2004
+++ View.pm     Fri Jul 30 23:35:19 2004
@@ -132,25 +132,25 @@
     }
     $extra .= " (not exist)";
   }

   if( $viewRaw ) {
     $extra .= " raw=$viewRaw";
+    if( $viewRaw !~ /debug/i ) {
+      $text = join( "\n", grep{ !/^%META:([^{]+){(.*)}%$/ } split( /\r?\n/, $text ) );
+    }
     if( $skin !~ /^text/ ) {
       my $vtext = "<form><textarea readonly=\"readonly\" wrap=\"virtual\" rows=\"%EDITBOXHEIGHT%\" cols=\"%EDITBOXWIDTH%\">";
       $vtext = &TWiki::handleCommonTags( $vtext, $topic );
       $text =~ s/&/&amp\;/go;
       $text =~ s/%/&\#037\;/go;
       $text =~ s/</&lt\;/go;
       $text =~ s/>/&gt\;/go;
       $text =~ s/\t/   /go;
       $text = "$vtext$text</textarea></form>";
     }
-    if( $viewRaw !~ /debug/i ) {
-      $text =~ s/%META[\:A-Z]*{[^\}]*}%[\n\r]*//gos;
-    }
   }

   TWiki::UI::writeDebugTimes( "view - get rev info" );

   if( ! $viewRaw ) {
     $text = &TWiki::handleCommonTags( $text, $topic );

-- PeterThoeny - 30 Jul 2004

Follow up

Hmm, it looks like this fix breaks MetaFieldNotShownInViewRawMode, back to the drawing board, aka keyboard.

-- PeterThoeny - 30 Jul 2004

OK, fixed both cases, this topic and MetaFieldNotShownInViewRawMode. Change is in SVN.

-- PeterThoeny - 30 Jul 2004

Topic revision: r5 - 31 Jul 2004 - 05:09:35 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback