Opened 9 years ago
Closed 9 years ago
#12252 closed defect (fixed)
Incorrect initialization of new custom fields in existing tickets.
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.2 |
Component: | ticket system | Version: | 1.0.2 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Tickets created before a custom field was added default to using the default value provided in the custom field definition. |
||
API Changes: | |||
Internal Changes: |
Description
When adding a custom field, it is possible to set what the default value should be when a new ticket is created, For existing tickets that do not yet have this value, the field seems to default to the first value (I have a 'select'-type variable). I would have expected it to be set to the same default value as for a new ticket. Is this expected behavior? I really would like all existing tickets to have the default value for this field.
It has been confirmed that this same behavior exists in the current trunk release.
Attachments (0)
Change History (6)
comment:1 by , 9 years ago
Milestone: | → 1.2 |
---|
comment:2 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Proposed changes in log:rjollos.git:t12252_ticket_custom_default. I'll add additional tests before committing.
The population of default ticket custom field values would probably benefit from a redesign. Even after the proposed changes, a value won't be stored for a ticket created before a custom field was added, until there is an update to that ticket. The behavior is probably odd to the user - a custom query that filters for a non-empty custom field only returning tickets that have been updated since the custom field was added.
follow-up: 4 comment:3 by , 9 years ago
Added a test in [12e4f578/rjollos.git]. Also modified TicketSystem.reset_ticket_fields
to clear the cached property custom_fields
, which was an issue discovered after writing the test.
comment:4 by , 9 years ago
Release Notes: | modified (diff) |
---|
Replying to Ryan J Ollos:
Also modified
TicketSystem.reset_ticket_fields
to clear the cached propertycustom_fields
, which was an issue discovered after writing the test.
It looks like this isn't needed outside of test execution since the environment is recreated when the trac.ini file contents change. Changing the [ticket-custom]
definition will therefore result in recomputing the cached ticket fields and custom fields.
In the test case I'll just explicitly del TicketSystem(self.env).custom_fields
.
comment:5 by , 9 years ago
Release Notes: | modified (diff) |
---|
comment:6 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [14369].
Discussed in gmessage:trac-users:PzCJd7DxXl8/FVFommcpBwAJ. We should try to fix the issue for milestone:1.2.