Modify

Opened 6 years ago

Last modified 4 years ago

#3532 new defect

handling of blank values is hacked

Reported by: abbywinterscom Owned by: abbywinterscom
Priority: normal Component: GridModifyPlugin
Severity: normal Keywords: tickets
Cc: Trac Release: 0.11

Description

See HACK below:

            for field in TicketSystem(self.env).get_ticket_fields():
                if field['type'] == 'select':
                    xpath = '//*[contains(@class, "tickets")]//td[contains(@class, "%s")]' % (field['name'])
                    select = tag.select(name=field['name'])
                    # HACK: For some reason custom fields that have a blank value
                    # as a valid option don't actually have that blank
                    # value among the options in field['options'] so
                    # we force a blank option in in the case where the
                    # _default_ value is blank.
                    if(field['value'] == '' and not ('' in field['options'])):
                        select.append(tag.option())
                    for option in field['options']:
                        select.append(tag.option(option, value=option))

I'm not sure if this is a defect in trac or in GridModifyPlugin. I suspect trac.

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.