Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7279 closed task (worksforme)

Ticket e-mails generated from Trac through trac-post-commit-hook have wrong URLs

Reported by: Jason Winnebeck <jpwasp@…> 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 Emmanuel Blot, 16 years ago

Resolution: worksforme
Status: newclosed

Look for "base_url" in your trac.ini file and define it: TracIni#trac-section

comment:2 by Jason Winnebeck <jpwasp@…>, 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 anonymous, 16 years ago

Resolution: worksforme
Status: closedreopened

comment:4 by anonymous, 16 years ago

Owner: changed from Christian Boos to anonymous
Status: reopenednew

comment:5 by anonymous, 16 years ago

Resolution: worksforme
Status: newclosed

in reply to:  5 comment:6 by anonymous, 16 years ago

Type: defecttask

Replying to anonymous:

comment:7 by Christian Boos, 16 years ago

TicketButcher playing here … please stop.

comment:8 by Jason Winnebeck <jpwasp@…>, 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 Jason Winnebeck <jpwasp@…>, 16 years ago

Sorry, I meant to reply to eblot, not cboos. cboos was just talking to the TicketButcher

comment:10 by Christian Boos, 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 Jason Winnebeck <jpwasp@…>, 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.

comment:12 by Christian Boos, 12 years ago

Milestone: 0.11

(clearing report:35)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anonymous.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from anonymous to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.