Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5170 closed defect (invalid)

Bad field name causes trace back when editing field values

Reported by: olaf.meeuwissen@… Owned by: osimons
Priority: normal Component: CustomFieldAdminPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

A TRAC_ADMIN on one of our local projects used the CustomFieldAdminPlugin to add a field with the name comment. After entering a comment editing of any text field (including Cc: and Keywords:) results in a trace back. Removing the custom field re-enables editing of text fields. Custom fields with other names work fine.

Are there other "bad" field names? If so, which ones?
I've noticed that CustomFields.update_custom_field() does some validation already. Would it be possible to validate against these before deciding to add such custom fields?

FWIW, we're using 0.2 (r4016) of the plugin with Trac-0.11.1 under Python 2.5. I've skimmed the revision log up to r5253 but it does not seem that the above has been addressed.

Trace back:

Traceback (most recent call last):
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/web_ui.py", line 170, in process_request
    return self._process_ticket_request(req)
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/web_ui.py", line 494, in _process_ticket_request
    self._do_save(req, ticket, action)
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/web_ui.py", line 989, in _do_save
    cnum=internal_cnum):
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/model.py", line 270, in save_changes
    (self.id, when_ts, author, cnum, comment))
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/sqlite_backend.py", line 58, in execute
    args or [])
  File "/opt/lib/python2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/sqlite_backend.py", line 50, in _rollback_on_error
    return function(self, *args, **kwargs)
IntegrityError: columns ticket, time, field are not unique

See also trac:ticket:6975 for something that may be related.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by osimons

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

Seeing that the plugin only writes to the trac.ini file (as if you had edited it manually), this isn't really a plugin issue. The problem is how Trac handles this particular name ('comment').

The problem is already reported, see trac:ticket:6975. And, it has just been fixed in trac:changeset:8167 so if you update to latest from 0.11 branch (or wait for 0.11.5) it should no longer be a problem.

Thanks for reporting.

comment:2 Changed 5 years ago by olaf.meeuwissen@…

Thanks. I guess I'll wait for 0.11.5 then and tell my users to not use comment for the time being.

Add Comment

Modify Ticket

Action
as closed .
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.