Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5508 closed defect (duplicate)

TicketQuery crashes Trac wiki

Reported by: rocky@… Owned by: Christian Boos
Priority: normal Milestone:
Component: wiki system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I was trying to show a ticket number and summary in the wiki (so the summary is pulled from the ticket as opposed to manually entering it as display link text). How should I accomplish this without triggering the following error?

I used the following TicketQuery macro:

[[TicketQuery(ticket=94)]]

When I pressed submit, I received the following error

Trac detected an internal error:
ProgrammingError: current transaction is aborted, commands ignored until
end of transaction block

When I previewed it on the Trac demo site, I received the following error:

Error: Macro TicketQuery(ticket=1) failed
no such column: t.ticket

When I tried to enter this ticket on Edgewall's trac system, I forgot to escape the TicketQuery and got the following Python traceback

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/ticket/web_ui.py", line 177, in process_request
    milestone = Milestone(self.env, option, db=db)
  File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 552, in __init__
    self._fetch(name, db)
  File "/usr/lib/python2.4/site-packages/trac/ticket/model.py", line 564, in _fetch
    "FROM milestone WHERE name=%s", (name,))
  File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.4/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: current transaction is aborted, commands ignored until end of transaction block

Attachments (0)

Change History (3)

comment:1 by anonymous, 17 years ago

Component: generalwiki
Owner: changed from Jonas Borgström to Christian Boos

comment:2 by rocky@…, 17 years ago

I was trying to show a single ticket number and summary in the wiki (so the summary is pulled from the ticket as opposed to manually entering it as display link text). I tried using TicketQuery by specifying a specific ticket (so the result would always be a single ticket). But trying to use ticket as a ticket field name causes an internal error. Is it possible to query the ticket number so as to avoid the error?

comment:3 by Christian Boos, 17 years ago

Resolution: duplicate
Status: newclosed

Use [[TicketQuery(id=94)]] instead (current trunk only).

In my test environments, even if it is expected not to work with with 0.10.4, it doesn't trigger an internal error; instead I get:

Error: Macro TicketQuery(id=94) failed
ERROR:  invalid input syntax for integer: ""

So I don't know exactly why this can sometimes trigger an internal error (PostgreSQL binding version or PostgreSQL version issue?), but that feature is not supported in 0.10.x, only in 0.11, see #2604.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.