Edgewall Software

Opened 9 years ago

Last modified 9 years ago

#11996 closed defect

incorrect milestone pre-selected in change properties dropdown menu when empty — at Initial Version

Reported by: ebouaziz@… Owned by:
Priority: normal Milestone: 1.1.5
Component: ticket system Version: 1.1.3
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

following #11018

Since Trac uses the null value to represent empty properties in the database, when the milestone of a ticket is empty, the milestone dropdown menu in the change properties area has the default milestone pre-selected instead of the empty one.

A visible effect is that if you simply want to add a comment on such a ticket, the milestone will be changed from empty to the default milestone, which is not empty in our case.

This does not happen on tickets that have an empty milestone represented as an empty string.

It also happens with the version property.

This happens because of the get_value_or_default() function in trac/ticket/model.py:

I believe the line:

    return value if value is not empty else self.get_default(name)

should be:

    return value if value is not empty else ''

This function is called only in trac/ticket/templates/ticket.html to fill the ticket's fields.

Change History (0)

Note: See TracTickets for help on using tickets.