Edgewall Software
Modify

Ticket #2829 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

PageOutline macro breaks on pages using the graphviz plugin

Reported by: rcastellucci@… Owned by: jonas
Priority: normal Milestone:
Component: wiki system Version: 0.9.4
Severity: normal Keywords:
Cc:

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

gviz.patch (605 bytes) - added by eblot 4 years ago.
Temporary workaround

Change History

comment:1 Changed 5 years ago by eblot

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

comment:2 Changed 5 years ago by cmlenz

Anything related in the logs (for example, a traceback)?

comment:3 Changed 5 years ago by rcastellucci

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:4 Changed 4 years ago by anonymous

comment:5 Changed 4 years ago by anonymous

  • Cc jgartrel added

comment:6 Changed 4 years ago by anonymous

  • Cc jgartrel removed

Changed 4 years ago by eblot

Temporary workaround

comment:7 Changed 4 years ago by eblot

I've attached a workaround patch:

  • discards debug traces that access the null req object
  • discards the assignation of self.base_url which not used anyway.

However, the root cause is not fixed: why req becomes None when both macros are used ?

comment:8 Changed 4 years ago by eblot

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

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.

comment:9 Changed 4 years ago by anonymous

asdfasdasd

comment:10 Changed 4 years ago by eblot

See #2916.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.