Opened 14 years ago
Closed 14 years ago
#9663 closed defect (fixed)
Ticket details in timeline includes empty changes from custom fields being added or deleted
Reported by: | osimons | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.1 |
Component: | timeline | Version: | 0.12dev |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When a custom field is created or deleted, any ticket edit will change the value either from None
→ ''
or the other way.
The effect of this can currently be witnessed in the t.e.o timeline by large amount of the 'API Changes, Release Notes edited' changes that are included without any real change - it is just because it is the first change to the ticket since the fields were added.
This patch ignores such changes:
-
trac/ticket/web_ui.py
a b 291 291 """ % (ts_start, ts_stop)) 292 292 data = None 293 293 for id,t,author,type,summary,field,oldvalue,newvalue in cursor: 294 if (oldvalue, newvalue) in ((None, ''), ('', None)): 295 # ignore empty change from custom field created or deleted 296 continue 294 297 if not data or (id, t) != data[:2]: 295 298 if data: 296 299 ev = produce_event(data, status, fields, comment, cid)
Let me know when the patch can be committed - I don't want to interfere with release.
PS! I'm quite sure we had this covered earlier? Have a feeling it is a regression, but can't remember any details anymore.
Attachments (0)
Change History (6)
follow-up: 2 comment:1 by , 14 years ago
follow-up: 3 comment:2 by , 14 years ago
Replying to rblank:
There's still another issue if you submit an empty ticket comment that also changes a field from
None
to the empty string. In that case you get an empty comment, and the "Reply" button overlaps the "Changed by …" heading.
Oh. As in you are allowed to post a change without any real changes? I see. I'll leave that one for you :-)
Those two patches may then be worth applying before 0.12.1 - especially since we have a good test server here at t.e.o for those two recently added custom fields…
comment:3 by , 14 years ago
Replying to osimons:
Those two patches may then be worth applying before 0.12.1
Your patch, certainly. Mine… doesn't exists yet :)
comment:4 by , 14 years ago
Maybe the test should be written if not (oldvalue or newvalue):
as this would avoid the creation of 3 temporary tuples.
comment:6 by , 14 years ago
Milestone: | 0.12.2 → 0.12.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Replying to cboos:
The regression feeling comes probably from #4447.
Yes, that is the one :-)
Committed fix for a second time in [10172] and merged to trunk in [10173].
Remy, I'm closing this one. For the other issue you mentioned, I presume you have a todo list or another ticket somewhere to keep track of that one.
I have made a few changes recently in the ticket model and request processing that removed some of these issues (i.e. they shouldn't be displayed as changes in ticket comments anymore). The timeline accesses the database directly, so I missed it.
There's still another issue if you submit an empty ticket comment that also changes a field from
None
to the empty string. In that case you get an empty comment, and the "Reply" button overlaps the "Changed by …" heading.