Modify

Opened 4 years ago

Closed 4 years ago

Last modified 10 months ago

#7311 closed defect (fixed)

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

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

Description

Hi,

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/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 235, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/tickettemplate/ttadmin.py", line 248, in process_request
    result = TT_Template.fetchAll(self.env, data)
  File "build/bdist.linux-i686/egg/tickettemplate/model.py", line 153, in fetchAll
    cursor.execute(sqlString % data)
  File "build/bdist.linux-i686/egg/trac/db/util.py", line 66, in execute
    return self.cursor.execute(sql)
  File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", line 78, in execute
    result = PyFormatCursor.execute(self, *args)
  File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", line 56, in execute
    args or [])
  File "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", 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 model.py

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by richard

  • Resolution set to fixed
  • Status changed from new to closed

(In [8172]) Fixed #7311

  • fix database execute code

comment:2 Changed 10 months ago by rjollos

In 13633:

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

Add Comment

Modify Ticket

Action
as closed The owner will remain richard.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.