[Trac] Ticket #1339 and cgi_location
Daniel Serodio
daniel.listas at xxx.com.br
Tue Jun 14 14:07:15 CDT 2005
I'm trying to fix #1627 (which I reported myself): the URL for "Save
Settings" is invalid when Trac is running under the root of a virtual
host. (It tries to submit to //settings/).
So I took a look at Changeset 1480 (fix URL for adding attachments when
running under root of a virtual host. Closes #1339
<http://projects.edgewall.com/trac/ticket/1339>). Basically, it replaces
"<?cs var:cgi_location?>" with "<?cs var:ticket.attach_href ?>".
cgi_location contains a single slash, which is an invalid URL. So I
grepped for cgi_location in the templates directory, and found that it's
used in attachment.cs, milestone.cs, newticket.cs, query.cs, report.cs,
settings.cs and ticket.cs.
So I think there are two possible sollutions for this problem:
1) Fix cgi_location so that it either contains the URL prefix for the
trac installation (ie including http://hostname/tracdir/) or it is blank
(in which case the resulting URL would be /settings/, which is valid).
or
2) Replace all ocurrences of cgi_location in the templates with a new
foo_href variable.
Which would be the best solution? I'm inclined to go with option 1, but
that would make Changeset 1480 and the foo_href variables unnecessary,
prompting for some "cleanup".
Thanks,
Daniel Serodio
More information about the Trac
mailing list