Closed Bug 301240 Opened 19 years ago Closed 19 years ago

editvalues.cgi should not update bugs.delta_ts

Categories

(Bugzilla :: Administration, task)

2.19.3
task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: altlist, Assigned: LpSolit)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041223 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041223 Firefox/1.0

I'm not sure what's supposed to happen, only that after I reran checksetup.pl,
all my "last modified" fields got set to today (mysql's NOW()).  I ended up
having to write a script that reset delta_ts based on the max bug_when in
longdescs and bugs_activity. 

It also seems bugs.delta_ts is supposed to hold the date, not a delta date.  Or
at least, the "last modified" text for each bug report looks correct if I set it
to the right date.

Granted, I have a couple custom patches, but I believe this is occurring with
the standalone 2.20rc1 copy. 



Reproducible: Always
Ah, it's not checksetup, but editvalues.cgi.  Whenever you change a field value,
all bugs that had that field modified gets the delta_ts field updated accordingly.
In my case, that impacted nearly all of my bugs.

I'm not sure I like that, for if you click on a specific bug, there is no
relevant info stating why the last_modified field got changed.  
Component: Installation & Upgrading → Administration
Summary: Bugzilla 2.20rc1 check_setup.pl resets delta_ts to NOW() → Bugzilla 2.20rc1 editvalues.cgi changes delta_ts
editvalues.cgi, line 358:

        $dbh->do("UPDATE bugs SET $field = ?, delta_ts = NOW()
                   WHERE $field = ?", undef, $value, $valueold);

So we explicitly update delta_ts here. But I agree, this doesn't make sense!
This would make sense only if users were getting an email about this change,
which is not the case here.

mkanat, can you justify this decision to update delta_ts?
Attached patch patch, v1 β€” β€” Splinter Review
The actual code breaks all queries based on the "last changed time". That's
bad!
Assignee: installation → LpSolit
Status: UNCONFIRMED → ASSIGNED
Attachment #189730 - Flags: review?(myk)
Target Milestone: --- → Bugzilla 2.20
Version: unspecified → 2.19.3
(In reply to comment #3)
> The actual code breaks all queries based on the "last changed time". That's
> bad!

Yes, this is how I originally found out about it and I personally don't like it.  
Albert, we all agree :)

(02:37:19) LpSolit: myk, could you have a look at my last comment in bug 301240?
I would like your opinion
(02:38:45) myk: LpSolit: it doesn't make sense to me either
(02:41:38) LpSolit: myk: ok, I will fix it now. The actual code breaks all
queries based on the "last changed time"
(02:42:29) myk: LpSolit: yeah, that sucks
(In reply to comment #5)
> Albert, we all agree :)

Great, can it be a 2.20 blocker?  It's a small change. 
Yeah, I don't know why I have that code there, either. :-)
Flags: blocking2.20+
Comment on attachment 189730 [details] [diff] [review]
patch, v1

Tested; works.
Attachment #189730 - Flags: review?(myk) → review+
I don't have a 2.20 branch ready, so I didn't check whether it applies.
Flags: approval?
Flags: approval2.20?
(In reply to comment #9)
> I don't have a 2.20 branch ready, so I didn't check whether it applies.

The patch applies cleanly for 2.20 too. This part of editvalues.cgi is still
marked as v1.1 (original file). ;)
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
tip:

Checking in editvalues.cgi;
/cvsroot/mozilla/webtools/bugzilla/editvalues.cgi,v  <--  editvalues.cgi
new revision: 1.4; previous revision: 1.3
done


2.20rc1:

Checking in editvalues.cgi;
/cvsroot/mozilla/webtools/bugzilla/editvalues.cgi,v  <--  editvalues.cgi
new revision: 1.3.2.1; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Summary: Bugzilla 2.20rc1 editvalues.cgi changes delta_ts → editvalues.cgi should not update bugs.delta_ts
(In reply to comment #0)
> I'm not sure what's supposed to happen, only that after I reran checksetup.pl,
> all my "last modified" fields got set to today (mysql's NOW()).  I ended up
> having to write a script that reset delta_ts based on the max bug_when in
> longdescs and bugs_activity. 

Would you care to share your script? We have a similar problem where adding a new group control to a bug product set all bugs as modified.
Attached file fix delta_ts β€”
Bernd, this is a rather old script.  You'll need to tweak it for the newer versions of Bugzilla. 

However, if adding a new group control to a bug product set all bugs as modified (for the latest bugzilla), then this in itself is probably a bug and should post a new ticket.
Thanks, your script did the trick. I had to tweak it a bit though, because adding the group permissions is noted in bugs_activity, so I had to filter the query from bugs_activity to bugs where 'added' contained the group I added. Worked like a charm!
BTW, I have filed Bug 380085 for my problem, but now (since I had a closer look at the DB), I am not sure if it is a bug after all... It is still annoying.
Attachment #264141 - Attachment mime type: application/octet-stream → text/plain
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: