Modify ↓
#12554 closed defect (fixed)
[PATCH] Broken link when viewing milestone page if version name contains spaces
Reported by: | Cinc-th | Owned by: | Cinc-th |
---|---|---|---|
Priority: | low | Component: | ExtendedVersionPlugin |
Severity: | minor | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
When viewing a milestone page the version information is added to the due/completed date line as can be seen here:
The link points to the page for that particular version.
With version names containing spaces the link is broken because only the first word of the version name is used to specify the link target. The following patch resolves the issue:
-
trunk/extendedversion/milestone.py
119 119 context = Context.from_request(req, 120 120 Resource('milestone', milestone)) 121 121 return tag.span( 122 "; ",123 122 format_to_oneliner(self.env, context, 124 " For version:%s" % (row[0],)),123 "; For [version:'%s' %s]" % (row[0], row[0])), 125 124 class_="date") 126 125 else: 127 126 return []
Attachments (1)
Change History (4)
Changed 9 years ago by
Attachment: | version_link_12554.patch added |
---|
comment:1 Changed 9 years ago by
I think we should directly create a link for the version rather than uses of format_to_oneline
. The format_to_*
methods are slow.
Untested patch:
-
extendedversionplugin/trunk/extendedversion/milestone.py
diff --git a/extendedversionplugin/trunk/extendedversion/milestone.py b/extendedversionplugin/trunk/extendedversion/milestone.py index 74816a4..2d0a85e 100644
a b from trac.resource import Resource 16 16 from trac.util.datefmt import to_timestamp 17 17 from trac.web.api import IRequestFilter, ITemplateStreamFilter 18 18 from trac.web.chrome import INavigationContributor 19 from trac.wiki.formatter import format_to_oneliner 19 20 from extendedversion.version import VisibleVersion 20 21 21 22 22 23 class MilestoneVersion(Component): … … class MilestoneVersion(Component): 118 119 if row: 119 120 context = Context.from_request(req, 120 121 Resource('milestone', milestone)) 121 return tag.span( 122 "; ", 123 format_to_oneliner(self.env, context, 124 "For version:%s" % (row[0],)), 125 class_="date") 122 link = VisibleVersion(self.env)._render_link(context, row[0], 123 row[0]) 124 return tag.span("; For ", link, class_="date") 126 125 else: 127 126 return [] 128 127
comment:3 Changed 9 years ago by
Owner: | changed from Ryan J Ollos to Cinc-th |
---|
Note: See
TracTickets for help on using
tickets.
Patch to allow links to versions with spaces in name.