Opened 16 years ago
Closed 15 years ago
#5309 closed defect (fixed)
[TracCiaPlugin] Wrong ticket link and postgresql error
Reported by: | Oliver Metz | Owned by: | Mikhail Gusarov |
---|---|---|---|
Priority: | normal | Component: | TracCiaPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
When a new ticket is created the link is displayed like this:
http://trac.freetz.org/ticket/459/459
The ticket number is appended twice. Attached is a patch to fix this and a postgresql error I got. (Sorry, lost error message. It was something like comment is not a valid column.)
-
__init__.py
200 200 elif action == 'created': 201 201 args['url'] = t_url + '/' + str(ticket.id) 202 202 args['log'] = 'Created ['+ticket['type']+']: ('+ticket['summary']+')' + (version and (' in ' + version) or '') 203 args['log'] += ' (' + t_url + ' /' + str(ticket.id) + ')'203 args['log'] += ' (' + t_url + ')' 204 204 elif action == 'changed': 205 205 old = kwargs.get('old_values', {}) 206 206 db = self.env.get_db_cnx() 207 207 cursor = db.cursor() 208 cursor.execute( 'SELECT count(*) FROM ticket_change WHERE ticket = %s and field = "comment"'% (ticket.id));208 cursor.execute("SELECT count(*) FROM ticket_change WHERE ticket = %s and field = 'comment'" % (ticket.id)); 209 209 r = cursor.fetchone() 210 210 num_comments = int(r and r[0] or 0) 211 211 if num_comments:
Attachments (0)
Change History (11)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
PostgreSQL fix committed.
Though I still don't see the problem with ticket.id: args['url'] = t_url + '/' + str(ticket.id)
does not change the value of t_url, so it's necessary to append the id again while adding the link to the log.
Anyway, either both url/log links should have ticket id appended, or both should not have it, depending on the actual value of t_url.
comment:4 Changed 16 years ago by
Sorry. You are right. I will take a closer look and try to find my problem.
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Okay, so I'm closing this ticket.
Thanks for SQL fix.
comment:6 Changed 16 years ago by
Can you explain to me why ticket delete and ticket changed methods don't need this str(ticket.id) in the url and log but the ticket create method does?
Can you give me a hint how I can do "dry runs" without creating a real ticket and how I can log something into trac.log?
Thank you.
comment:7 Changed 16 years ago by
Ask the trac guys :) Arguments are non-consistent.
Regarding dry runs - no idea. I'm just using a local test trac instance.
comment:8 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Next new ticket was created. Log message as follows:
CIA-1: Whoopie tickets/kernel * #461 /: Created [defect]: (7170 crashes with usb-root and "replace kernel") in devel (http://trac.freetz.org/ticket/461/461)
I'm using the actual svn revision without modifications.
comment:9 Changed 16 years ago by
With this patch I get the following message:
-
traccia/__init__.py
f
201 201 args['url'] = t_url + '/' + str(ticket.id) 202 202 args['log'] = 'Created ['+ticket['type']+']: ('+ticket['summary']+')' + (version and (' in ' + version) or '') 203 203 args['log'] += ' (' + t_url + '/' + str(ticket.id) + ')' 204 self.log.warn('Ticket URL: %s', t_url) 204 205 elif action == 'changed': 205 206 old = kwargs.get('old_values', {}) 206 207 db = self.env.get_db_cnx()
trac.log:
2009-06-05 10:03:32,270 Trac[__init__] WARNING: Ticket URL: http://trac.freetz.org/ticket/462
comment:11 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Yes, confirmed, and fix committed in r6389.
Did you try the latest svn version? I fixed the similar bug some time ago.