Modify

Opened 7 years ago

Closed 3 years ago

Last modified 2 years ago

#2413 closed defect (fixed)

[Patch] 0.11 support

Reported by: joshland@… Owned by: rjollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: joshland@… Trac Release: 0.11

Description

Mimeview.render requires a context object. Since I do not know how to obtain a context object from a 'req' object, I changed it from render_macro to expand_macro.

I needed to display wiki pages and nothing worked. Here is the error I got when render_macro called:

            out = Mimeview(self.env).render(req, dest_format, out)

error

2008-01-14 14:29:08,498 Trac[api] WARNING: HTML preview using <trac.mimeview.api.WikiTextRenderer object at 0x2aaaafb22390> failed (req)
Traceback (most recent call last):
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/mimeview/api.py", line 630, in render
    rendered_content, filename, url)
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/mimeview/api.py", line 992, in render
    content_to_unicode(self.env, content, mimetype))
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 1088, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 1046, in generate
    Formatter(self.env, self.context).format(self.wikidom, out,
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 229, in __init__
    self.req = context.req
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/web/api.py", line 171, in __getattr__
    raise AttributeError(name)
AttributeError: req

Attachments (1)

includemacros-0.11-nodebug.diff (2.6 KB) - added by joshland@… 7 years ago.
should apply cleanly with patch -p2

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by joshland@…

should apply cleanly with patch -p2

comment:1 follow-up: Changed 7 years ago by joshland@…

The preview doesn't show - I do not know why. The patch seems to download fine.

comment:2 Changed 5 years ago by anonymous

  • Summary changed from IncludeMacro patch to support 0.11 to [Patch] 0.11 support

comment:3 Changed 4 years ago by rjollos

  • Owner changed from coderanger to rjollos
  • Status changed from new to assigned

comment:4 in reply to: ↑ 1 Changed 3 years ago by rjollos

Replying to joshland@gmail.com:

The preview doesn't show - I do not know why. The patch seems to download fine.

This is a defect with the trac-hacks site. Thanks for the patch btw, it looks good.

comment:5 Changed 3 years ago by rjollos

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

(In [11266]) Fixes #2413: Replaced call to deprecated render_macro with expand_macro.

comment:6 Changed 2 years ago by rjollos

This ticket is a follow-on to [3610], where initial work was done to port the 0.10 version of IncludeMacro to 0.11.

comment:7 Changed 2 years ago by rjollos

(In [11530]) Refs #2413:

  • Partial revert of [11266]. Set the realm for the context explicitly since it is not clear that it will be correct in many cases if we get the context from the formatter object.
  • Added a changelog.
  • Changed the maintainer.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.