

While investigating a related problem (Bugs.Item1101), I realize that, the way getScriptUrl is currently written, either all or no scripts' path have to be defined in {ScriptUrlPaths}, for shorter-urls setup.

Intuitively, I had previously considered this variable as a way to define exceptions. What should it really do ? I tend to go on thinking it should allow to define exceptions to {ScriptUrlPath}.

Here is the patch that achieves this (against svn r7706) :

--- TWiki.pm.orig       2005-12-02 07:00:15.000000000 +0100
+++ TWiki.pm    2005-12-02 08:27:24.000000000 +0100
@@ -872,7 +872,7 @@
     # $this->{urlHost} is needed, see Codev.PageRedirectionNotWorking
     my $url;
-    if( defined $TWiki::cfg{ScriptUrlPaths} ) {
+    if( defined $TWiki::cfg{ScriptUrlPaths}{$script} ) {
         $url = $TWiki::cfg{ScriptUrlPaths}{$script};
     unless( $url ) {

No, the current code is correct. If at least one scripturlpath is defined, then $url is defined as the ScriptUrlPath for that script. If no path is set for that script, $url will be set to undef and the following code, which says unless($url), will trigger.


Summary {ScriptUrlPaths} should allow to define exceptions, but the current getScriptUrl implementation obliges the admin to define a path in it for every script or none.
ReportedBy BenVoui

SVN Range 7706
AppliesTo Engine

Priority Urgent
CurrentState No Action Required

Topic revision: r4 - 2005-12-02 - CrawfordCurrie
Ideas, requests, problems regarding TWiki? Send feedback