Opened 18 months ago

Last modified 18 months ago

#14141 accepted enhancement

Allow wiki-Syntax in

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords: patch
Cc: Ryan J Ollos Trac Release: 1.4


Since r14524 it is not possible to include wiki-syntax to scalar-value output. For example, it is a nice feature to count the tickets of a user and point to the corresponding report:

SELECT '([query:?status=!closed&owner={{1}} '||count(id)||'],' FROM ticket WHERE status!="closed" AND owner="{{1}}"

The previous behaviour can be restored with the following patch:

  • (a) a/ vs. (b) b/

    diff --git a/ b/
    index 0a9657a..037147c 100644
    a b  
    1111from import add_stylesheet
    12 from import system_message
     12from import format_to_oneliner, system_message
    1313from import WikiMacroBase
    1414from trac.util.html import html as tag
    1515from trac.util.text import exception_to_unicode
    1616from trac.util.translation import _
    1918class SQLScalar(WikiMacroBase):
    2019    """Output a number from a scalar (1x1) SQL query.
    class SQLScalar(WikiMacroBase): 
    3938        else:
    4039            value = rows[0][0] if len(rows) else "(NULL)"
    42         add_stylesheet(formatter.req, 'wikitable/css/wikitable.css')
    43         return tag.span(value, class_='wikiscalar')
     41        return format_to_oneliner(self.env, formatter.context, value)

Attachments (0)

Change History (2)

comment:1 Changed 18 months ago by figaro

Keywords: patch added

comment:2 Changed 18 months ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

Modify Ticket

Change Properties
Set your email in Preferences
as accepted The owner will remain Ryan J Ollos.

Add Comment

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

Note: See TracTickets for help on using tickets.