Closed Bug 298196 Opened 20 years ago Closed 20 years ago

process_bug.cgi updates delta_ts even when no modifications are made

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

2.19.3
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

The culprits are votes and keywords, see my patch.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Version: unspecified → 2.19.3
Attached patch patch, v1Splinter Review
Fix two problems:
1) process_bug.cgi has no idea if the "keywords" field has changed or not till
it checks all fields at the end of the process. Thus, delta_ts should not be
updated while this information is unknown.

2) For bugs having no votes, votes = 0 (as expected). But the code incorrectly
set $votes ||= '' which is wrong for this numeric field.
Attachment #186766 - Flags: review?(mkanat)
Blocks: 271023
Comment on attachment 186766 [details] [diff] [review]
patch, v1

>-            SendSQL("UPDATE bugs SET delta_ts = $sql_timestamp, keywords = " .
>-                    SqlQuote(join(', ', @list)) .
>-                    " WHERE bug_id = $id");
>+            $dbh->do("UPDATE bugs SET keywords = ? WHERE bug_id = ?",
>+                     undef, join(', ', @list), $id);

  OK. So if I only update the keywords, with this patch applied, the delta_ts
is still set correctly? Provided that's the case, thi is r+ on inspection.

>-        $newvalues[$i] ||= '';
>+        $newvalues[$i] = defined($newvalues[$i]) ? $newvalues[$i] : '';

  And yeah, this is obviously correct. It *actually* does what the comment
says, now. :-)
Attachment #186766 - Flags: review?(mkanat) → review+
(In reply to comment #2)
>   OK. So if I only update the keywords, with this patch applied, the delta_ts
> is still set correctly?

Yes, but later in the code, where we have checked that keywords have really been
changed.
Flags: approval?
Blocks: 286679
Flags: approval? → approval+
Checking in process_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v  <--  process_bug.cgi
new revision: 1.260; previous revision: 1.259
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: