Edgewall Software
Modify

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  
    291291                """ % (ts_start, ts_stop))
    292292            data = None
    293293            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
    294297                if not data or (id, t) != data[:2]:
    295298                    if data:
    296299                        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)

comment:1 by Remy Blank, 14 years ago

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.

in reply to:  1 ; comment:2 by osimons, 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…

in reply to:  2 comment:3 by Remy Blank, 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 Christian Boos, 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:5 by Christian Boos, 14 years ago

The regression feeling comes probably from #4447.

in reply to:  5 comment:6 by osimons, 14 years ago

Milestone: 0.12.20.12.1
Resolution: fixed
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.