Modify

Opened 17 years ago

Closed 13 years ago

Last modified 13 years ago

#2413 closed defect (fixed)

[Patch] 0.11 support

Reported by: Joshua Schmidlkofer Owned by: Ryan J Ollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: Joshua Schmidlkofer 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 Joshua Schmidlkofer 17 years ago.
should apply cleanly with patch -p2

Download all attachments as: .zip

Change History (8)

Changed 17 years ago by Joshua Schmidlkofer

should apply cleanly with patch -p2

comment:1 Changed 17 years ago by Joshua Schmidlkofer

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

comment:2 Changed 15 years ago by anonymous

Summary: IncludeMacro patch to support 0.11[Patch] 0.11 support

comment:3 Changed 14 years ago by Ryan J Ollos

Owner: changed from Noah Kantrowitz to Ryan J Ollos
Status: newassigned

comment:4 in reply to:  1 Changed 13 years ago by Ryan J Ollos

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 13 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

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

comment:6 Changed 13 years ago by Ryan J Ollos

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 13 years ago by Ryan J Ollos

(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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.