Modify

Opened 7 years ago

Last modified 7 years ago

#1880 new defect

[PATCH] URLs for projects in the project index are incorrect

Reported by: mpalmer@… Owned by: coderanger
Priority: normal Component: TracForgePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

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.

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by anonymous

  • Summary changed from URLs for projects in the project index are incorrect to [PATCH] URLs for projects in the project index are incorrect

Add Comment

Modify Ticket

Action
as new The owner will remain coderanger.
Author


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

 
Note: See TracTickets for help on using tickets.