Modify

Opened 18 years ago

Closed 18 years ago

Last modified 12 years ago

#1267 closed defect (fixed)

[patch] fix error when there's no ticket.blocking set in a ticket

Reported by: phpxcache Owned by: Noah Kantrowitz
Priority: high Component: MasterTicketsPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.10

Description

this happen for old tickets which were created before custom field is added

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 239, in dispatch
    template, content_type = self._post_process_request(req,
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 269, in _post_process_request
    content_type)
  File "build/bdist.linux-i686/egg/mastertickets/web_ui.py", line 56, in post_process_request
AttributeError: 'NoneType' object has no attribute 'replace'
Index: mastertickets/web_ui.py
===================================================================
--- mastertickets/web_ui.py (revision 2071)
+++ mastertickets/web_ui.py (working copy)
@@ -53,8 +53,9 @@

             # Linkify the 'Blocks' field
             blocks_ids = req.hdf.get('ticket.blocking')
-            blocks_ids = blocks_ids.replace('#', '')
             if blocks_ids:
+               blocks_ids = blocks_ids.replace('#', '')
+            if blocks_ids:
                 blocks_ids = [x.strip() for x in blocks_ids.split(',')]
                 req.hdf['project.footer'] = Markup(req.hdf['project.footer'] + Markup(html.DIV(linkify_ids(self.env, req, blocks_ids), id='linkified_blocking', style='display:none')))
                 add_script(req, 'mastertickets/linkify_blocking.js')

Attachments (0)

Change History (2)

comment:1 Changed 18 years ago by Noah Kantrowitz

Resolution: fixed
Status: newclosed

(In [2079]) Handle pre-existing tickets. (Closes #1241, #1267)

comment:2 Changed 12 years ago by Ryan J Ollos

(In [12867]) MasterTicketsPlugin:

Handle pre-existing tickets. (Closes #1241, #1267)

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.