Modify

Opened 4 years ago

Last modified 3 years ago

#6324 new defect

[Patch] No links to tickets / URL: None/ticket/...

Reported by: root@… Owned by: xpech
Priority: normal Component: IcalViewPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Events in ical don't have backward links to correspondong tickets.

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by anonymous

Do you use Windows as server platform ?

comment:2 Changed 4 years ago by xpech

Do you use Windows as server platform ?

comment:3 Changed 4 years ago by xpech

We use it every day, so the URL of tickets is set. So it must be a bug. Can you open a generated .ics file with a text editor, check the value of an URL: (line beginning with URL:) and report here if the url seems to be worst.

Many thanks for all you reports and using my plugin.

comment:4 Changed 4 years ago by anonymous

comment:5 Changed 3 years ago by fecht

  • Summary changed from No links to tickets to [Patch] No links to tickets / URL: None/ticket/...

Got the same problem (might be related to using or not using base_url and or apache 2.2 or .... ) running on OS X Server.

In any case I have attached a 'quick' fix/patch that works for me (and with trac 0.12).

Index: icalview/icalview.py
===================================================================
--- icalview/icalview.py	(revision 9693)
+++ icalview/icalview.py	(working copy)
@@ -194,9 +194,15 @@
                 self.format_date(content,"DTSTAMP",result["changetime"])
                 protocol = "http"
                 if os.getenv('SERVER_PROTOCOL') != None :
+                    host = os.getenv('SERVER_NAME')
                     if "HTTPS" in os.getenv('SERVER_PROTOCOL') :
                         protocol = "https"
-                content.write("URL:%s://%s%s\r\n" % (protocol,os.getenv('SERVER_NAME'),get_resource_url(self.env,ticket,req.href)))
+                else :
+                    host = req.get_header('Host')
+                    if req.server_port == 443 :
+                        protocol = "https"
+                content.write("URL:%s://%s%s\r\n" % (protocol,host,get_resource_url(self.env,ticket,req.href)))
+
                 priority = None
                 try:
                     priority = priority_map[result['priority']]

However, this fix 'requires' that https uses port 443 for it to work, it doesn't check, which protocol is used...

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.