Closed Bug 670906 Opened 14 years ago Closed 14 years ago

delta_ts is updated even when there are no changes

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

4.1.2
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: gerv, Assigned: gerv)

References

Details

Attachments

(1 file)

delta_ts is updated by Bug.update() even when there are no changes. This is a regression on the tip, caused by the checkin for bug 620827. http://bzr.mozilla.org/bugzilla/trunk/revision/7699 Tiago removed the @ signs in the line (around 964): if (scalar @$removed_see || scalar @$added_see) { -> if (scalar $removed_see || scalar $added_see) { Because those two variables are arrayrefs, those checks always now pass, rather than depending on whether the arrays have anything in them. Which means that $changes->{see_also} is always populated (albeit with an empty arrayref), which means that, later down the file, the test to see if there were any changes always passes, so delta_ts is always updated. This bug was found by the BzAPI regression test suite. Patch forthcoming. Gerv
Attached patch Patch v.1Splinter Review
Assignee: create-and-change → gerv
Status: NEW → ASSIGNED
Attachment #545365 - Flags: review?
Attachment #545365 - Flags: review? → review?(timello)
Comment on attachment 545365 [details] [diff] [review] Patch v.1 Review of attachment 545365 [details] [diff] [review]: ----------------------------------------------------------------- Thank you! ::: Bugzilla/Bug.pm @@ +960,5 @@ > $_->remove_from_db foreach @$removed_see; > $_->insert_create_data($_) foreach @$added_see; > > # If any changes were found, record it in the activity log > + if (scalar @$removed_see || scalar @$added_see) { Oh indeed! That's true.
Attachment #545365 - Flags: review?(timello) → review+
Flags: approval?
Depends on: 620827
Flags: blocking4.2+
Flags: approval?
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
Version: unspecified → 4.1.2
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/Bug.pm Committed revision 7857. Gerv
Status: ASSIGNED → RESOLVED
Closed: 14 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: