Re: TicketQuery and wikiformatting

52 views
Skip to first unread message

RjOllos

unread,
Jul 1, 2012, 1:50:07 AM7/1/12
to trac-...@googlegroups.com


On Friday, June 29, 2012 2:12:26 AM UTC-7, Pardah wrote:
Hi all,

I have a ticket query as follows

[[TicketQuery(status=new,order=id,desc=1,format=table,col=summary|owner|description)]]

Now, the description of these tickets contains Wikiformatting which isn't being rendered. If the description is put on a new row then it does come up with the formatting. Is it possible for the wikiformatting to be rendered when the description is in a column?

It does not appear to be currently supported. Here is the relevant source:

http://trac.edgewall.org/browser/trunk/trac/ticket/templates/query_results.html?marks=77-86,91,101#L65

So you'd have to submit an enhancement request. Here is a patch against r11100 of the Trac trunk which I think does the job. It has been very lightly tested ;)

Index: trac-trunk/trac/ticket/templates/query_results.html
===================================================================
--- trac-trunk/trac/ticket/templates/query_results.html    (revision 11100)
+++ trac-trunk/trac/ticket/templates/query_results.html    (working copy)
@@ -80,6 +80,7 @@
                       <py:when test="name == 'reporter'">${authorinfo(value)}</py:when>
                       <py:when test="name == 'cc'">${format_emails(ticket_context, value)}</py:when>
                       <py:when test="name == 'owner' and value">${authorinfo(value)}</py:when>
+                      <py:when test="name == 'description'">${wiki_to_html(ticket_context, value)}</py:when>
                       <py:when test="name == 'milestone'"><a py:if="value" title="View milestone" href="${href.milestone(value)}">${value}</a></py:when>
                       <py:when test="header.wikify">${wiki_to_oneliner(ticket_context, value)}</py:when>
                       <py:otherwise>$value</py:otherwise>

RjOllos

unread,
Jul 1, 2012, 1:54:47 AM7/1/12
to trac-...@googlegroups.com
Btw, in terms of a patch, I could see two ways of dealing with this:

Just always format the Description column as wiki, which I think makes sense, and this is what the one-line patch does.

Allow for an explicit specification of columns that should be wiki-formatted. For example, add a `wikicol` option:

[[TicketQuery(status=new,order=id,desc=1,format=table,col=summary|owner, wikicol=description)]]
Reply all
Reply to author
Forward
0 new messages