#7279 closed task (worksforme)
Ticket e-mails generated from Trac through trac-post-commit-hook have wrong URLs
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | 0.11-stable |
Severity: | minor | Keywords: | trac-post-commit-hook svn integration |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When I update a ticket, the e-mail from Trac comes out with the proper footer URLs, but not when the changes are as the result of trac-post-commit-hook
(I am using last change r5308 of 0.11-stable).
My hook script:
#!/bin/sh REPOS="$1" REV="$2" TRAC_ENV='/srv/trac/AHM/' /usr/bin/python "$REPOS/hooks/trac-post-commit-hook" \ -p "$TRAC_ENV" \ -r "$REV"
I removed a lot of parameters that were required in the old version that are now marked "deprecated".
The result I get from the ticket footer:
Ticket URL: </ticket/271#comment:2> AHM Project <https://mysecretserver/trac/AHM> AHM Project
What I expect:
Ticket URL: <https://mysecretserver/trac/ticket/271#comment:2> AHM Project <https://mysecretserver/trac/AHM> AHM Project
All other fields in the mail are proper.
I am using r7166 in 0.11-stable
Attachments (0)
Change History (12)
comment:1 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Hmm, I thought I tried hard this time to make sure it wasn't something like that, but I didn't have it defined. I've defined it, so next time it happens I'll wait and see if it works. Thanks eblot.
comment:3 by , 16 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
comment:4 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
follow-up: 6 comment:5 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:8 by , 16 years ago
There's one thing I don't get here, cboos. In the first link it doesn't know the base_url, but if I didn't define it, why does the second link come out properly?
I realized that in my original configuration, I had url
defined in [project]
section. Why do I need to define both url
and base_url
, especially if both of them will have the same value? The TracIni says
URL of the main project web site, usually the website in which the base_url resides
But in my project I set them both to the same value. And if url
can be either an absolute or relative link, then it doesn't make sense because then url
should always be .
?
comment:9 by , 16 years ago
Sorry, I meant to reply to eblot, not cboos. cboos was just talking to the TicketButcher
comment:10 by , 16 years ago
The rationale is that it make sense to get a default value for the project url from the value of base_url, but the reverse is not true. See the discussion in #3932, in particular ticket:3932#comment:11.
The reason why setting the base_url from the project url was not even considered is that we can't assume the project url would lead to Trac, as it can link to some "main" site.
So in your case, just define the [trac] base_url
and leave the [project] url
setting empty.
We could eventually improve the doc to make that more obvious, suggestions welcomed.
comment:11 by , 16 years ago
Hmm I guess that the TracIni can't be edited just through wiki only.
Suggestion, from:
URL of the main project web site, usually the website in which the base_url resides.
to:
URL of the main project web site, usually the website in which the base_url resides, but does not have to point to the Trac site. If not specified, the value for base_url is used.
And also optionally add "If the Trac site is the main project web site, you may leave this parameter unspecified and only specify base_url". Adding that may be a little redundant, though.
Look for "base_url" in your
trac.ini
file and define it: TracIni#trac-section