Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#7307 closed defect (duplicate)

Comment diffs do not work in Trac 0.12 with MasterTicketsPlugin enabled

Reported by: ed.porter@… Owned by: Noah Kantrowitz
Priority: normal Component: MasterTicketsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

Trac 0.12 allows ticket comments to be edited, and comments that have been edited gain a "diff" button. Clicking here should show the comment's change history, but with MasterTicketsPlugin enabled it causes an error:

Oops…
Trac detected an internal error:

KeyError: 'fields'



Python Traceback
Most recent call last:

    * File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request
      Local variables:
      Name	Value
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x2b17b7227190>
      e 	<exceptions.KeyError instance at 0x2b17ba1035f0>
      env 	<trac.env.Environment object at 0x2b17b67ae610>
      env_error 	None
      req 	<Request "GET '/ticket/2716'">
      resp 	[]
    * File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 245, in dispatch
      Local variables:
      Name	Value
      chosen_handler 	<trac.ticket.web_ui.TicketModule object at 0x2b17b7227350>
      chrome 	<trac.web.chrome.Chrome object at 0x2b17b71bebd0>
      e 	<exceptions.TypeError instance at 0x2b17ba103710>
      err 	(<class exceptions.KeyError at 0x2b17b3505950>, <exceptions.KeyError ...
      handler 	<trac.ticket.web_ui.TicketModule object at 0x2b17b7227350>
      req 	<Request "GET '/ticket/2716'">
      resp 	('diff_view.html', {'longcol': '', 'new_version': 1, 'cnum': 3, ...
      self 	<trac.web.main.RequestDispatcher object at 0x2b17b7227190>
    * File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 359, in _post_process_request
      Local variables:
      Name	Value
      args 	('diff_view.html', {'longcol': '', 'new_version': 1, 'cnum': 3, ...
      extra_arg_count 	3
      f 	<mastertickets.web_ui.MasterTicketsModule object at 0x2b17b7227490>
      nbargs 	3
      req 	<Request "GET '/ticket/2716'">
      resp 	('diff_view.html', {'longcol': '', 'new_version': 1, 'cnum': 3, ...
      self 	<trac.web.main.RequestDispatcher object at 0x2b17b7227190>
    * File "build/bdist.linux-i686/egg/mastertickets/web_ui.py", line 64, in post_process_request
      Code fragment:
      Line	
      59	# Add link to depgraph if needed
      60	if links:
      61	add_ctxtnav(req, 'Depgraph', req.href.depgraph(tkt.id))
      62	
      63	for change in data.get('changes', []):
      64	for field, field_data in change['fields'].iteritems():
      65	if field in self.fields:
      66	if field_data['new'].strip():
      67	new = set([int(n) for n in field_data['new'].split(',')])
      68	else:
      69	new = set()
      Local variables:
      Name	Value
      change 	{'diffs': [[{'base': {'lines': [<Markup u''>, <Markup u'And the answer is ...
      content_type 	None
      data 	{'longcol': '', 'new_version': 1, 'cnum': 3, 'num_changes': 1, 'diff': ...
      links 	<mastertickets.model.TicketLinks #2716 blocking=[] blocked_by=[]>
      req 	<Request "GET '/ticket/2716'">
      self 	<mastertickets.web_ui.MasterTicketsModule object at 0x2b17b7227490>
      template 	'diff_view.html'
      tkt 	<trac.ticket.model.Ticket object at 0x2b17ba09f390>

File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_requestFile "build/bdist.linux-x86_64/egg/trac/web/main.py", line 245, in dispatchFile "build/bdist.linux-x86_64/egg/trac/web/main.py", line 359, in _post_process_requestFile "build/bdist.linux-i686/egg/mastertickets/web_ui.py", line 64, in post_process_request
  for field, field_data in change['fields'].iteritems():

System Information:

User Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.3) Gecko/20100404 Fedora/3.6.3-0.el5.mh Firefox/3.6.3

The comment diff is displayed as expected if MasterTicketsPlugin is disabled.

Attachments (0)

Change History (1)

comment:1 Changed 14 years ago by Grzegorz Sobański

Resolution: duplicate
Status: newclosed

Duplicate of #3920

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
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.