Tags:
create new tag
, view all tags

Bug: TOC Doesnt Honour $scriptSuffix

The title says it all

Test case

Kinda hard to do: need an unpatched TWiki with scriptsuffix set!

Environment

TWiki version: The 20 Mar 04 Beta
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- MartinGregory - 09 Apr 2004

Follow up

Note that this bug is in superseded by the solution to TOCLinkURIRefsNotRelative, if that bug is fixed in the way that I suggested.

If it is not fixed in the way that I suggested, then this patch seems to do the job (though because I couldn't see what the original change that caused the problem was trying to do, this might be undoing something else!!)


*** TWiki.pm~   Sat Mar 20 04:57:38 2004
--- TWiki.pm    Fri Apr  9 03:28:44 2004
***************
*** 2343,2355 ****
                  $line =~ s/([\s\(])($regex{wikiWordRegex})/$1<nop>$2/g;  # 'TopicName'
                  $line =~ s/([\s\(])($regex{abbrevRegex})/$1<nop>$2/g;  # 'TLA'
                  # create linked bullet item
!                 # AB change
!               # $line = "$tabs* <a href=\"$dispScriptUrlPath/$viewScript$scriptSuffix/$webPath/$topicname#$anchor\">$line</a>";
!               if ( $viewScript eq 'view' ) {
!                   $line = "$tabs* <a href=\"$dispScriptUrlPath$dispViewPath/$webPath/$topicname#$anchor\">$line</a>";
!               } else {
!                   $line = "$tabs* <a href=\"$dispScriptUrlPath/$viewScript$scriptSuffix/$webPath/$topicname#$anchor\">$line</a>";
!               }
                  $result .= "\n$line";
              }
          }
--- 2343,2359 ----
                  $line =~ s/([\s\(])($regex{wikiWordRegex})/$1<nop>$2/g;  # 'TopicName'
                  $line =~ s/([\s\(])($regex{abbrevRegex})/$1<nop>$2/g;  # 'TLA'
                  # create linked bullet item
!               # MartinGregory: this used to create an absolute URI.  DanielBarclay reported this as a bug, and I tend
!               # to agree so I got rid of the absolute part... if the following is commented out, then someone else didn't agree!
!               # $line = "$tabs* <a href=\"#$anchor\">$line</a>";
!               # MartinGregory: AB had the following code replacing the old version of the single line above.
!               # He didn't say why... it's not clear to me what it is doing.  In any case, I added $scriptSuffix in the place
!               # where he had missed it out...
!               if ( $viewScript eq 'view' ) {
!                   $line = "$tabs* <a href=\"$dispScriptUrlPath$dispViewPath$scriptSuffix/$webPath/$topicname#$anchor\">$line</a>";
!               } else {
!                   $line = "$tabs* <a href=\"$dispScriptUrlPath/$viewScript$scriptSuffix/$webPath/$topicname#$anchor\">$line</a>";
!               }
                  $result .= "\n$line";
              }
          }
 

-- MartinGregory - 09 Apr 2004

This bug was introduced by ShorterURLs and fixed by TOCLinkURIRefsNotRelative. I do not mark it as a CairoRelease bug since it was introduced recently.

-- PeterThoeny - 10 Apr 2004

Fix record

Topic revision: r3 - 2004-04-10 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.