#935 closed defect (fixed)
Invalid relative path on TracGuideToc.py when invoked from the start page
| Reported by: | Juanma Barranquero | Owned by: | Christopher Lenz |
|---|---|---|---|
| Priority: | low | Milestone: | 0.8 |
| Component: | wiki system | Version: | devel |
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I've copied TracGuideToc.py for a Contents menu on my own installation. However, if you call it from the main WikiStart page and you've invoked it with
http://localhost/wiki
instead of
http://localhost/wiki/trac
the relative locations for the TOC items are wrong (they refer to http://localhost/trac/MyPage instead of http://localhost/trac/wiki/MyPage.
This is not going to fail on the Trac Project site because the TOC is never invoked from WikiStart, but still it'd be better to patch the macro:
-
trac/wikimacros/TracGuideToc.py
35 35 cls = '' 36 html += '<li %s><a href=" %s">%s</a></li>' % (cls, ref, title)36 html += '<li %s><a href="/trac/wiki/%s">%s</a></li>' % (cls, ref, title) 37 37 return html + '</ul></div>'
Attachments (0)
Change History (8)
comment:1 by , 21 years ago
| Milestone: | → 0.8 |
|---|---|
| Owner: | changed from to |
| Severity: | enhancement → minor |
| Status: | new → assigned |
comment:2 by , 21 years ago
| Component: | general → wiki |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Should be fixed in [1062].
comment:3 by , 21 years ago
| Summary: | Invalid relative path on !TracGuideToc.py when invoked from /trac → Invalid relative path on TracGuideToc.py when invoked from the start page |
|---|
comment:4 by , 21 years ago
Nice, I didn't know about Href.py (obviously). I'll try to be more careful (use the Source, Luke!).
comment:5 by , 21 years ago
Oh, another comment: TracGuide.py is included in 0.8, but the updated Wiki pages that use it don't (nor are they updated in the trunk).
comment:7 by , 21 years ago
| Summary: | Invalid relative path on TracGuideToc.py when invoked from the start page → Invalid relative path on !TracGuideToc.py when invoked from the start page |
|---|
comment:8 by , 21 years ago
| Summary: | Invalid relative path on !TracGuideToc.py when invoked from the start page → Invalid relative path on TracGuideToc.py when invoked from the start page |
|---|



We cannot rely on Trac running under the path
/trac, so this patch won't work. However, we should be able to use Href.py to get links that work in any situation.Let's fix this for 0.8.