Modify

Opened 8 years ago

Closed 7 years ago

Last modified 17 months ago

#1267 closed defect (fixed)

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

Reported by: phpxcache Owned by: coderanger
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 7 years ago by coderanger

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

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

comment:2 Changed 17 months ago by rjollos

(In [12867]) MasterTicketsPlugin:

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

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.