Ticket #4138 (closed defect: fixed)
Opened 5 years ago
Last modified 5 years ago
Links points wrong in a heading
| Reported by: | ext@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | low | Milestone: | 0.11 |
| Component: | wiki system | Version: | devel |
| Severity: | minor | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
Overview Description:
The href of a link in a heading points outside the environment.
Steps to Reproduce:
- Edit any page
- Insert "= [wiki:foo Foo] ="
- Save page
Actual Results:
All seems fine except the href:
http://a-domain.com/wiki/foo
Expected Results:
http://a-domain.com/my_env/wiki/foo
Attachments
Change History
comment:1 Changed 5 years ago by eblot
comment:2 follow-up: ↓ 3 Changed 5 years ago by ext@…
Changing the base_url helps. Why is this necessary when everything else works without this?
comment:3 in reply to: ↑ 2 Changed 5 years ago by cboos
- Component changed from general to wiki
- Milestone set to 0.11
- Owner changed from jonas to cboos
- Status changed from new to assigned
Well, because it's a tiny bug ;)
comment:4 follow-up: ↓ 5 Changed 5 years ago by cboos
Fixed in r4245, but as Emmanuel said, the base_url setting is now nearly mandatory. Perhaps this should be made more apparent in the docs.
I think we should start a TracDev/ReleaseNotes/0.11 page...
comment:5 in reply to: ↑ 4 Changed 5 years ago by eblot
Replying to cboos:
Fixed in r4245, but as Emmanuel said, the base_url setting is now nearly mandatory. Perhaps this should be made more apparent in the docs.
I don't know the internal details so the following suggestion might not be applicable: would there be any way to infer the actual value from other parameters such as TracUriRoot? It seems that the base url parameter needs to be replicated in both the web server configuration file and the trac configuration file, maybe one of them could be retrieved from the other one?
comment:6 follow-up: ↓ 7 Changed 5 years ago by cboos
The base_url information is effectively derived from the web server configuration in a few situations, and can also be generally recovered from the URL itself (see source:trunk/trac/web/api.py@4245#L152), but there are a few situations where we don't have access to the req, and then the only possibility is to use directly env.abs_href which makes use of the base_url info.
comment:7 in reply to: ↑ 6 Changed 5 years ago by eblot
Replying to cboos:
there are a few situations where we don't have access to the req, and then the only possibility is to use directly env.abs_href which makes use of the base_url info.
I'm pretty sure I miss an important point, but base_url is not tied to a request: it's a static value. Is there no possibiilty to retrieve this value at startup and keep it in the environment, for example?
comment:8 Changed 5 years ago by cboos
- Resolution set to fixed
- Status changed from assigned to closed
Actual problem fixed in r4245. If needed, the base_url discussion should be moved elsewhere...



Double check that your base_url option is well defined in your trac.ini file.
See also #4105.