Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#7311 closed defect (fixed)

Plugins failed to work when a ticket type name contains a single quote

Reported by: orio Owned by: Richard Liao
Priority: normal Component: TracTicketTemplatePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12



When updating our Trac instance from 0.11 to 0.12, the plugin failed to work because of a ticket type containing a single quote.

The ticket type name was: Demande d'ouverture

Here the trace generated when trying to create a new ticket:

2010-06-29 14:37:58,716 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/", line 513, in _dispatch_request
  File "build/bdist.linux-i686/egg/trac/web/", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/tickettemplate/", line 248, in process_request
    result = TT_Template.fetchAll(self.env, data)
  File "build/bdist.linux-i686/egg/tickettemplate/", line 153, in fetchAll
    cursor.execute(sqlString % data)
  File "build/bdist.linux-i686/egg/trac/db/", line 66, in execute
    return self.cursor.execute(sql)
  File "build/bdist.linux-i686/egg/trac/db/", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "build/bdist.linux-i686/egg/trac/db/", line 56, in execute
    args or [])
  File "build/bdist.linux-i686/egg/trac/db/", line 48, in _rollback_on_error
    return function(self, *args, **kwargs)
OperationalError: near "ouverture": syntax error

We dirtyfix the plugin using double quote instead of single quote inside the sqlString to enclose variables in

Attachments (0)

Change History (2)

comment:1 Changed 10 years ago by Richard Liao

Resolution: fixed
Status: newclosed

(In [8172]) Fixed #7311

  • fix database execute code

comment:2 Changed 6 years ago by Ryan J Ollos

In 13633:

0.8: Bump version to 0.8. Added SVN revision to egg. Refs #6589, #6809, #7311, #7404, #7440, #8555, #8609, #9238, #10858.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Richard Liao.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.