#2829 closed defect (fixed)
PageOutline macro breaks on pages using the graphviz plugin
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | wiki system | Version: | 0.9.4 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
If I use the PageOutline macro on a page that is using the graphviz plugin, I get the following error:
Error: Macro PageOutline(None) failed
'NoneType' object has no attribute 'args'
Attachments (1)
Change History (11)
comment:1 by , 20 years ago
comment:3 by , 20 years ago
16:18:59 Trac[formatter] DEBUG: Executing Wiki macro PageOutline by provider <trac.wiki.macros.PageOutlin
eMacro object at 0x4113acac>
16:18:59 Trac[formatter] DEBUG: Executing Wiki macro graphviz by provider <graphviz.graphviz.GraphvizMacr
o object at 0x4113abac>
16:18:59 Trac[graphviz] DEBUG: dir(req): ['__class__', '__delattr__', '__doc__', '__getattribute__', '__h
ash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__']
16:18:59 Trac[formatter] ERROR: Macro PageOutline(None) failed
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 369, in _macro_formatter
return macro.process(self.req, args, 1)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 108, in process
text = self.processor(req, text)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 98, in _macro_processor
return macro_provider.render_macro(req, self.name, text)
File "/usr/lib/python2.3/site-packages/trac/wiki/macros.py", line 189, in render_macro
max_depth=max_depth, min_depth=min_depth))
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 756, in wiki_to_outline
min_depth)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 711, in format
Formatter.format(self, text, NullOut())
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 576, in format
self.handle_code_block(line)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 546, in handle_code_block
self.out.write(self.code_processor.process(self.req, self.code_text))
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 108, in process
text = self.processor(req, text)
File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 98, in _macro_processor
return macro_provider.render_macro(req, self.name, text)
File "build/bdist.linux-i686/egg/graphviz/graphviz.py", line 91, in render_macro
AttributeError: 'NoneType' object has no attribute 'args'
comment:5 by , 20 years ago
| Cc: | added |
|---|
comment:6 by , 20 years ago
| Cc: | removed |
|---|
comment:7 by , 20 years ago
I've attached a workaround patch:
- discards debug traces that access the null
reqobject - discards the assignation of
self.base_urlwhich not used anyway.
However, the root cause is not fixed: why req becomes None when both macros are used ?
comment:8 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Ok, I think I got it:
macro renders wiki content, so when it encounters another macro, it attempts to render it, but does not forward the request object to the nested macro.
I'm closing this ticket, and re-opening a new ticket about this nested macro issue.
Closing has fixed (ticket number to come), as the workaround allows to make it work, and the cause is not related to the graphviz macro, but the way it is called.



I can confirm it also occurs with the trunk version [2944].