Opened 15 years ago
Last modified 5 years ago
#6784 new defect
Fails with multiple pages and AddComment macro
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | TracWikiPrintPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
I am using TracWikiPrintPlugin to make a PDF from a couple of pages. These pages may each have the AddComment macro. It seems, however, that when TracWikiPrintPlugin is doing it's thing, the pages are handled in such a way that the TracAddCommentMacro macro thinks it has been added more than once. This is not the case on any individual page. I can view all the constituent pages just fine. It is only the TracWikiPrintPlugin processing that has a problem. From the log:
2010-03-09 08:54:16,396 Trac[formatter] ERROR: Macro AddComment(None) failed: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Trac-0.12multirepos-py2.5.egg/trac/wiki/formatter.py", line 494, in _macro_formatter return macro.process(args, in_paragraph=True) File "/usr/lib/python2.5/site-packages/Trac-0.12multirepos-py2.5.egg/trac/wiki/formatter.py", line 192, in process text = self.processor(text) File "/usr/lib/python2.5/site-packages/Trac-0.12multirepos-py2.5.egg/trac/wiki/formatter.py", line 179, in _macro_processor text) File "build/bdist.linux-i686/egg/addcomment/macro.py", line 41, in expand_macro raise TracError('\'AddComment\' macro cannot be included twice.') TracError: 'AddComment' macro cannot be included twice. 2010-03-09 08:54:16,549 Trac[macros] WARNING: Executing pre-0.11 Wiki macro Include by provider <class 'includemacro.macros.IncludeMacro'>
Attachments (1)
Change History (5)
comment:1 Changed 15 years ago by
Status: | new → assigned |
---|
comment:2 Changed 15 years ago by
l1.txt is the full log when the page creation fails. Oddly, the failure is not 100% of the time. Sometimes it works. Same pages (no content changes) and same order.
comment:3 Changed 15 years ago by
I think the log is showing only WARNING and ERROR information, could you lower log level to DEBUG?
Also, I reported this to AddCommentMacro in #6785
comment:4 Changed 5 years ago by
Owner: | Álvaro Iradier deleted |
---|---|
Status: | assigned → new |
Could you include the full log for the page conversion?
I guess this is a problem with AddComment checking it's not being included twice in the same web page. WikiPrint renders all the book pages from wiki syntax to HTML, and AddComment might think it's been included twice:
a workaround for this could be removing the addcommentmacro attribute from the request, but I think this is a dirty fix. Maybe it'd be better to restore the previous req state, or maybe the fix should be in AddCommentMacro (for example, store the name of the page instead of just True in the request attribute.