Modify ↓
#94 closed defect (worksforme)
Macro ListTypes failed under Trac 0.9.2
Reported by: | Owned by: | Alec Thomas | |
---|---|---|---|
Priority: | normal | Component: | TracHacksPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description
Since I've updated my insatllation to 0.9.2 I'm getting this error if I use "ListTypes"
Error: Macro ListTypes() failed 'NoneType' object has no attribute 'title'
Attachments (0)
Change History (3)
comment:1 Changed 19 years ago by
Component: | TracHacks → TracHacksPlugin |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
comment:2 Changed 19 years ago by
Yes, I'm using TracHacksPlugin.
2005-12-13 17:09:27,970 Trac[formatter] ERROR: Macro ListTypes() failed Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 376, in _macro_formatter return macro.process(self.req, args, 1) File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 110, in process text = self.processor(req, text) File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 101, in _macro_processor return macro_provider.render_macro(req, self.name, text) File "build/bdist.linux-i686/egg/trachacks/trachacks.py", line 50, in render_macro AttributeError: 'NoneType' object has no attribute 'title'
comment:3 Changed 19 years ago by
Aha..the way ListTypes works is to use the first level 1 heading as the "title". eg. = Foo =
I'll update the source. Apply this diff and it should fix the bug:
-
trachacks/trachacks.py
47 47 title = title.group(1).strip() 48 48 body = re.sub('=+\s([^=]*)=+', '', body, 1) 49 49 else: 50 title = title.title()50 title = page 51 51 body = re.sub('\\[\\[TagIt.*', '', body) 52 52 out.write('<legend style="color: #999;"><a href="%s">%s</a></legend>\n' % (self.env.href.wiki(page), title)) 53 53 out.write('%s\n' % wiki_to_html(body, self.env, req))
Note: See
TracTickets for help on using
tickets.
Are you using the TracHacksPlugin?
It works fine here and with the information you've provided I can't really help you. I would need at least a traceback.