• 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.
bit chicken and egg this - takeOutBlocks is being called without $session->{Renderer} being initialised, and TWiki::Render needs Prefs to be parsed already.

not sure why takeOutBlocks and putBackBlocks are methonds - they don't seem to use $this..

Software error:

Assertion failed!
 at /usr/lib/cgi-bin/MAIN/lib/Assert.pm line 92
   Assert::ASSERT('') called at /usr/lib/cgi-bin/MAIN/lib/TWiki.pm line 2569
   TWiki::handleCommonTags('TWiki=HASH(0x814f624)', ' Hugh Pugh Barney McGrew ', 'TestCases', 'ThisForm') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Form.pm line 191
   TWiki::Form::_parseFormDefinition('TWiki::Form=HASH(0x8aef730)', 'This is a test fixture\x{d}\x{a}\x{d}\x{a}| *Name* | *Type* | *Size* | *Value...') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Form.pm line 98
   TWiki::Form::new('TWiki::Form', 'TWiki=HASH(0x814f624)', 'TestCases', 'ThisForm') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Compatibility.pm line 168
   TWiki::Compatibility::upgradeCategoryTable('TWiki=HASH(0x814f624)', 'TestCases', 'TestCaseAutoCategoryTable1', 'TWiki::Meta=HASH(0x8ae3114)', 'Description: Test for category table and attachment upgrading...') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Store.pm line 1371
   TWiki::Store::extractMetaData('TWiki::Store=HASH(0x88f7a60)', 'TWiki::Meta=HASH(0x8ae3114)', 'SCALAR(0x8ad49c4)') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Store.pm line 145
   TWiki::Store::readTopic('TWiki::Store=HASH(0x88f7a60)', 'undef', 'TestCases', 'TestCaseAutoCategoryTable1', 'undef') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Prefs/PrefsCache.pm line 137
   TWiki::Prefs::PrefsCache::loadPrefsFromTopic('TWiki::Prefs::PrefsCache=HASH(0x8ad4730)', 'TestCases', 'TestCaseAutoCategoryTable1', 'undef') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Prefs/PrefsCache.pm line 88
   TWiki::Prefs::PrefsCache::new('TWiki::Prefs::PrefsCache', 'TWiki::Prefs=HASH(0x8ab15d0)', 'TWiki::Prefs::PrefsCache=HASH(0x8ad4754)', 'TOPIC', 'TestCases', 'TestCaseAutoCategoryTable1', 'undef') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/Prefs.pm line 115
   TWiki::Prefs::pushPreferences('TWiki::Prefs=HASH(0x8ab15d0)', 'TestCases', 'TestCaseAutoCategoryTable1', 'TOPIC') called at /usr/lib/cgi-bin/MAIN/lib/TWiki.pm line 1394
   TWiki::new('TWiki', 'undef', 'CGI=HASH(0x814f600)', 'HASH(0x88d3cd8)') called at /usr/lib/cgi-bin/MAIN/lib/TWiki/UI.pm line 151
   TWiki::UI::run('CODE(0x819cd80)', 'view', 1) called at /usr/lib/cgi-bin/MAIN/bin/view line 31

For help, please send mail to the webmaster (webmaster@localhost), giving this error message and the time and date of the error. 

Yuck - the patch to fix this is:

sven@t42p:/usr/lib/cgi-bin/MAIN$ svn diff  lib/TWiki/Render.pm lib/TWiki.pm
Index: lib/TWiki/Render.pm
===================================================================
--- lib/TWiki/Render.pm (revision 12488)
+++ lib/TWiki/Render.pm (working copy)
@@ -869,8 +869,8 @@
     my $removedVerbatim = {};
     my $removedLiterals = {};

-    $text = $this->takeOutBlocks( $text, 'literal', $removedLiterals );
-    $text = $this->takeOutBlocks( $text, 'verbatim', $removedVerbatim );
+    $text = takeOutBlocks( $text, 'literal', $removedLiterals );
+    $text = takeOutBlocks( $text, 'verbatim', $removedVerbatim );

     $text = $this->takeOutProtected( $text, qr/<\?([^?]*)\?>/s,
                                      $removedComments );
@@ -886,7 +886,7 @@
     # here.
     $plugins->startRenderingHandler( $text, $theWeb, $theTopic );

-    $text = $this->takeOutBlocks( $text, 'pre', $removed );
+    $text = takeOutBlocks( $text, 'pre', $removed );

     # Join lines ending in '\' (don't need \r?, it was removed already)
     $text =~ s/\\\n//gs;
@@ -1093,19 +1093,19 @@

     unless( TWiki::isTrue( $prefs->getPreferencesValue('NOAUTOLINK')) ) {
         # Handle WikiWords
-        $text = $this->takeOutBlocks( $text, 'noautolink', $removed );
+        $text = takeOutBlocks( $text, 'noautolink', $removed );
         $text =~ s/$STARTWW(?:($TWiki::regex{webNameRegex})\.)?($TWiki::regex{wikiWordRegex}|$TWiki::regex{abbrevRegex})($TWiki::regex{anchorRegex})?/$this->_handleWikiWord($theWeb,$1,$2,$3)/geom;-        $this->putBackBlocks( \$text, $removed, 'noautolink' );
+        putBackBlocks( \$text, $removed, 'noautolink' );
     }

-    $this->putBackBlocks( \$text, $removed, 'pre' );
+    putBackBlocks( \$text, $removed, 'pre' );

     # DEPRECATED plugins hook after PRE re-inserted
     $plugins->endRenderingHandler( $text );

     # replace verbatim with pre in the final output
-    $this->putBackBlocks( \$text, $removedVerbatim, 'verbatim', 'pre', \&verbatimCallBack );
-    $this->putBackBlocks( \$text, $removedLiterals, 'literal', '');
+    putBackBlocks( \$text, $removedVerbatim, 'verbatim', 'pre', \&verbatimCallBack );
+    putBackBlocks( \$text, $removedLiterals, 'literal', '');

     $text =~ s|\n?<nop>\n$||o; # clean up clutch

@@ -1356,7 +1356,7 @@

 =pod

----++ ObjectMethod takeOutBlocks( \$text, $tag, \%map ) -> $text
+---++ staticMethod takeOutBlocks( \$text, $tag, \%map ) -> $text

    * =$text= - Text to process
    * =$tag= - XHTML-style tag.
@@ -1378,8 +1378,7 @@
 =cut

 sub takeOutBlocks {
-    my( $this, $intext, $tag, $map ) = @_;
-    ASSERT($this->isa( 'TWiki::Render')) if DEBUG;
+    my( $intext, $tag, $map ) = @_;

     return $intext unless( $intext =~ m/<$tag\b/i );

@@ -1433,7 +1432,7 @@

 =pod

----++ ObjectMethod putBackBlocks( \$text, \%map, $tag, $newtag, $callBack ) -> $text
+---++ StaticMethod putBackBlocks( \$text, \%map, $tag, $newtag, $callBack ) -> $text

 Return value: $text with blocks added back
    * =\$text= - reference to text to process
@@ -1462,8 +1461,7 @@
 =cut

 sub putBackBlocks {
-    my( $this, $text, $map, $tag, $newtag, $callback ) = @_;
-    ASSERT($this->isa( 'TWiki::Render')) if DEBUG;
+    my( $text, $map, $tag, $newtag, $callback ) = @_;

     $newtag = $tag if (!defined($newtag));

Index: lib/TWiki.pm
===================================================================
--- lib/TWiki.pm        (revision 12488)
+++ lib/TWiki.pm        (working copy)
@@ -1775,9 +1775,9 @@
     my $highest = 99;
     my $result  = '';
     my $verbatim = {};
-    $text = $this->{renderer}->takeOutBlocks( $text, 'verbatim',
+    $text = TWiki::Render::takeOutBlocks( $text, 'verbatim',
                                                $verbatim);
-    $text = $this->{renderer}->takeOutBlocks( $text, 'pre',
+    $text = TWiki::Render::takeOutBlocks( $text, 'pre',
                                                $verbatim);

     # Find URL parameters
@@ -2260,7 +2260,7 @@
     }

     my $verbatim = {};
-    $text = $this->{renderer}->takeOutBlocks( $text, 'verbatim',
+    $text = TWiki::Render::takeOutBlocks( $text, 'verbatim',
                                                $verbatim);

     # See Item1442
@@ -2355,7 +2355,7 @@

     #$stackTop =~ s/$percent/%/go;

-    $this->{renderer}->putBackBlocks( \$stackTop, $verbatim, 'verbatim' );
+    TWiki::Render::putBackBlocks( \$stackTop, $verbatim, 'verbatim' );

     #print STDERR "FINAL $stackTop\n" if $tell;

@@ -2566,7 +2566,9 @@

     #use a "global var", so included topics can extract and putback
     #their verbatim blocks safetly.
-    $text = $this->{renderer}->takeOutBlocks( $text, 'verbatim',
+    #ASSERT(defined($this->{renderer}));
+    #die 'here' unless (defined($this->{renderer}));
+    $text = TWiki::Render::takeOutBlocks( $text, 'verbatim',
                                               $verbatim);

     my $memW = $this->{SESSION_TAGS}{INCLUDINGWEB};
@@ -2576,7 +2578,7 @@

     $this->_expandAllTags( \$text, $theTopic, $theWeb );

-    $text = $this->{renderer}->takeOutBlocks( $text, 'verbatim',
+    $text = TWiki::Render::takeOutBlocks( $text, 'verbatim',
                                               $verbatim);


@@ -2599,7 +2601,7 @@
     # table rows properly
     $text =~ s/^<nop>\r?\n//gm;

-    $this->{renderer}->putBackBlocks( \$text, $verbatim, 'verbatim' );
+   TWiki::Render::putBackBlocks( \$text, $verbatim, 'verbatim' );

     # TWiki Plugin Hook (for cache Plugins only)
     $this->{plugins}->afterCommonTagsHandler( $text, $theTopic, $theWeb );
@@ -2919,7 +2921,7 @@

            unless( TWiki::isTrue( $this->{prefs}->getPreferencesValue('NOAUTOLINK')) ) {
                # Handle WikiWords
-               $text = $this->{renderer}->takeOutBlocks( $text, 'noautolink', $removed );
+               $text = TWiki::Render::takeOutBlocks( $text, 'noautolink', $removed );
            }

         # 'TopicName' to 'Web.TopicName'
@@ -2927,7 +2929,7 @@
         $text =~ s/(^|[\s(])($regex{wikiWordRegex})/$1$includedWeb\.$2/go;
         $text =~ s/(^|[\s(])$TranslationToken/$1/go;

-        $this->{renderer}->putBackBlocks( \$text, $removed, 'noautolink' );
+        TWiki::Render::putBackBlocks( \$text, $removed, 'noautolink' );
     }

     # handle tags again because of plugin hook

the above patch will break FindElsewherePlugin /DBCachePlugin/ EditContrib InlineEditPlugin

and is a pretty non-trivial change frown

so I'd like to propse we remove the autoUpgradeCategoryTable code (and this testcase) - as it was in use in one company, for only a mater of a month..

Kenneth, please advise

SD

I have now read up what the feature is in the first place and it seems to be related to upgrading from earlier versions of TWiki and mysterious betas.

I understand that the error in the log is triggered by a topic with no meta data which is not at all a normal situation.

Is it used in other situations?

Does it fail in other situations?

It is pretty risky to cut out code now and if it does not get activated other than with topics that have wrong format then it may be better to wait

KJL

One more detail.

The test case TestCaseAutoCategoryTable1 does not fail. And it does not produce any errors or warnings in my apache log.

And if I save the two test topics it correctly adds the meta data. So I do not see any problem at all.

Local problem in your end maybe?

Or lib problem?

KJL

Noone else on #twiki could reproduce this so lowering this to normal. Giving Sven a chance to add to the report.

The above suggested fixes are not getting near 4.1 anyway and I am sure the real fix needs some more thinking.

KJL

I think i'll delete that checkout, and start fresh, if I see it again, i'll re-open this

SD

Cleaned "WaitingFor" field.

-- TWiki:Main.GilmarSantosJr - 10 Aug 2008

ItemTemplate
Summary TestCases/TestCaseAutoCategoryTable1 fails hard
ReportedBy TWiki:Main.SvenDowideit
Codebase ~twiki4
SVN Range TWiki-4.1.0, Thu, 04 Jan 2007, build 12435
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-08-10 - GilmarSantosJr
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback