Edgewall Software

Ticket #925: ticket-custom-field-label-with-wiki-syntax-r4458.patch

File ticket-custom-field-label-with-wiki-syntax-r4458.patch, 1.2 kB (added by Tim Hatch <trac@…>, 20 months ago)

Updated patch for r4458

  • trac/ticket/api.py

     
    2424from trac.util.html import html 
    2525from trac.util.text import shorten_line 
    2626from trac.util.datefmt import utc 
    27 from trac.wiki import IWikiSyntaxProvider, Formatter 
     27from trac.wiki import IWikiSyntaxProvider, Formatter, Context 
    2828 
    2929 
    3030class ITicketChangeListener(Interface): 
     
    160160    def get_custom_fields(self): 
    161161        fields = [] 
    162162        config = self.config['ticket-custom'] 
     163        c = Context(self.env, None) 
    163164        for name in [option for option, value in config.options() 
    164165                     if '.' not in option]: 
    165166            field = { 
    166167                'name': name, 
    167168                'type': config.get(name), 
    168169                'order': config.getint(name + '.order', 0), 
    169                 'label': config.get(name + '.label') or name.capitalize(), 
     170                'label': c.wiki_to_oneliner(config.get(name + '.label') or name.capitalize()), 
    170171                'value': config.get(name + '.value', '') 
    171172            } 
    172173            if field['type'] == 'select' or field['type'] == 'radio':