incorrect milestone pre-selected in change properties dropdown menu when empty
|Reported by:||Owned by:||Ryan J Ollos|
Fixed: default milestone selected after ticket creation when milestone empty.
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
I believe the line:
return value if value is not empty else self.get_default(name)
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.