Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#2829 closed defect (fixed)

PageOutline macro breaks on pages using the graphviz plugin

Reported by: rcastellucci@… 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)

gviz.patch (605 bytes ) - added by Emmanuel Blot 19 years ago.
Temporary workaround

Download all attachments as: .zip

Change History (11)

comment:1 by Emmanuel Blot, 19 years ago

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

comment:2 by Christopher Lenz, 19 years ago

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

comment:3 by rcastellucci, 19 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 anonymous, 19 years ago

Cc: jgartrel added

comment:6 by anonymous, 19 years ago

Cc: jgartrel removed

by Emmanuel Blot, 19 years ago

Attachment: gviz.patch added

Temporary workaround

comment:7 by Emmanuel Blot, 19 years ago

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 by Emmanuel Blot, 19 years ago

Resolution: fixed
Status: newclosed

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 by anonymous, 19 years ago

asdfasdasd

comment:10 by Emmanuel Blot, 19 years ago

See #2916.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.