[PATCH] URLs for projects in the project index are incorrect
|Reported by:||mpalmer@…||Owned by:|
At present, the links for other projects in the Project Index look like this:
<a href="/thisproject/projects/other_project" title="Other Project Desc">Other Project Name</a>
Which, when clicked on, produces a "No handler matched request" error and a really ugly page.
this patch "solves" the problem (for me) by using env.project_path when it's set instead of the href.projects hoo-hah. The patch will not solve the problem for anyone who doesn't set url in the [project] section of their config file, but I'm not sure how many people don't set the project URL (I certainly don't trust Trac to get it right all the time). Auto-calculating the URL is always going to be tricky anyway, for people who have non-standard URL to project mappings, so the patch uses the explicitly-set value when available, and only auto-calcuates when it needs to. This way, when req.href.projects gets fixed, it'll work for everyone regardless of their URL layout!
There is some fragility in the check of env.project_url for a "default value" -- I'm explicitly checking against a hard-coded string which is the current default. If there's a way to check an environment attribute for "this is unset, using the default" that should be used, but I'm not knowledgeable about the Trac API.