• 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.

Item3794: Links in notifications broken when using shorter URLs

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension ActionTrackerPlugin Normal Closed   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

We have shorter URLs in use with our TWiki installation i.e. links are of form http://hostname/Web/Page instead of http://hostname/twiki/bin/view/Web/Page. The plugin seems to work fine except that in email notifications some of the links are broken.

There's a subsititute clause (listed below) in the ActionNotify.pm file that looks for links without the host in them that doesn't seem to work properly with shorter URLs. In our case the script URL path is an empty string so the substitute also finds the URLs that already have the host in them and adds another host part in the beginning (http://hostnamehttp://hostname/Web/Page).

    # add the url host to any in-twiki urls that lack it
    my $sup = TWiki::Func::getScriptUrlPath();
    my $sun = TWiki::Func::getUrlHost() . $sup;
    $text =~ s/href=\"$sup/href=\"$sun/ogi;
    $text =~ s/<\/?nop( \/)?>//goi;

I don't know if we can assume that all links start with a slash but if so then changing the first substitute clause to following might do the trick. I'm sure that more TWiki savy coders can easily find a suitable solution for this issue.

    $text =~ s/href=\"\//href=\"$sun/ogi;

-- TWiki:Main/HarriLakkala - 20 Mar 2007

That's not a bad solution, though it needs just a fraction of refinement.

CC

ItemTemplate
Summary Links in notifications broken when using shorter URLs
ReportedBy TWiki:Main.HarriLakkala
Codebase 4.1.0
SVN Range TWiki-4.1.2, Sat, 17 Mar 2007, build 13167
AppliesTo Extension
Component ActionTrackerPlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:13958
TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2007-05-28 - TWikiUserMapping_CrawfordCurrie
 
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