Opened 10 years ago
Closed 10 years ago
#11996 closed defect (fixed)
incorrect milestone pre-selected in change properties dropdown menu when empty
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | ticket system | Version: | 1.1.3 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed: default milestone selected after ticket creation when milestone empty. |
||
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.
Attachments (0)
Change History (5)
comment:1 by , 10 years ago
Milestone: | → 1.1.5 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 10 years ago
comment:4 by , 10 years ago
Release Notes: | modified (diff) |
---|
Proposed changes in log:rjollos.git:t11996.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to 1.0-stable in [13944], merged to trunk in [13945:13946]
I can reproduce the issue on 1.0-stable as well, I think it's not related to #11018.
Proposed fix:
trac/ticket/templates/ticket.html