id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 12857,Normalize default value of checkbox custom field,Jun Omae,Ryan J Ollos,"Creating new ticket with checkbox field which has `42` for default value via web ui, the field would have `1` or `0`. {{{#!ini [ticket-custom] check = checkbox check.value = 42 }}} {{{ sqlite> SELECT t.id, t.summary, c.value FROM ticket AS t LEFT JOIN ticket_custom AS c ON c.ticket=t.id AND c.name='check'; 1|Checked|1 2|Unchecked|0 }}} However, the default value would be stored for the checkbox field via application code instead of `1|0`. {{{ $ ~/venv/trac/1.0.15/bin/python Python 2.5.6 (r256:88840, Oct 21 2014, 22:49:55) [GCC 4.8.2] on linux2 Type ""help"", ""copyright"", ""credits"" or ""license"" for more information. >>> from trac.env import Environment >>> env = Environment('/dev/shm/tracenv') >>> from trac.ticket.model import Ticket >>> ticket = Ticket(env) >>> ticket['summary'] = 'via plugin' >>> ticket.insert() 3 >>> for name in sorted(ticket.values): name, ticket[name] ... ('changetime', datetime.datetime(2017, 7, 6, 12, 42, 59, 479729, tzinfo=)) (u'check', u'42') # <== neither 1 nor 0 ('owner', '') ('priority', u'major') ('summary', 'via plugin') ('time', datetime.datetime(2017, 7, 6, 12, 42, 59, 479729, tzinfo=)) ('type', u'defect') }}} I consider we should normalize default value for checkbox custom fields to have `1|0`.",defect,closed,normal,1.2.3,ticket system,1.0.15,normal,fixed,,,,,Normalized value of custom field checkbox to `1`/`0`.,