id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
3082,'summary' feature doesn't work with 0.11b2 (at least) - AttributeError: 'NoneType' object has no attribute 'ticket',nicholas,Shun-ichi Goto,"I was getting this traceback:
{{{
2008-05-27 14:18:00,628 Trac[formatter] ERROR: Macro TicketBox({9},summary) failed
Traceback (most recent call last):
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 468, in _macro_formatter
return macro.process(args, in_paragraph=True)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 179, in process
text = self.processor(text)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 166, in _macro_processor
text)
File ""e:\synergycmtrac\trac-project\plugins\TicketBox.py"", line 170, in expand_macro
return execute(formatter, args)
File ""e:\synergycmtrac\trac-project\plugins\TicketBox.py"", line 138, in execute
env, env.get_db_cnx()) for k,v in long_items.iteritems()], ""
"")
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 1123, in wiki_to_oneliner
OneLinerFormatter(env, context).format(wikitext, out, shorten)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 950, in format
result = re.sub(self.wikiparser.rules, self.replace, result)
File ""C:\Python25\lib\re.py"", line 142, in sub
return _compile(pattern, 0).sub(repl, string, count)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 804, in replace
replacement = self.handle_match(fullmatch)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\wiki\formatter.py"", line 797, in handle_match
return external_handler(self, match, fullmatch)
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\ticket\api.py"", line 298, in
lambda x, y, z: self._format_link(x, 'ticket', y[1:], y, z))
File ""c:\python25\lib\site-packages\Trac-0.11b2-py2.5.egg\trac\ticket\api.py"", line 319, in _format_link
href = formatter.href.ticket(num) + params + fragment
AttributeError: 'NoneType' object has no attribute 'ticket'
}}}
and this patch seems to help:
{{{
#!diff
--- TicketBox.py.orig 2008-05-27 14:25:22.341401500 +0100
+++ TicketBox.py 2008-05-27 14:21:41.227781200 +0100
@@ -134,7 +134,9 @@
html = ''
if show_summary:
html = string.join([wiki_to_oneliner(""%s (#%d)"" % (v,k),
- env, env.get_db_cnx()) for k,v in long_items.iteritems()], ""
"")
+ env,
+ env.get_db_cnx(),
+ req=formatter.req) for k,v in long_items.iteritems()], ""
"")
else:
html = wiki_to_oneliner(string.join([""#%d"" % c for c in items], "", ""),
env, env.get_db_cnx(), req=formatter.req)
}}}",defect,closed,normal,TicketBoxMacro,normal,fixed,,,0.11