Closed Bug 389916 Opened 17 years ago Closed 17 years ago

The "remaining_time_zeroed" message is displayed even if none of the bugs being changed has its remaining time > 0

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file)

If no bug has its remaining time cleared because it was already 0, we shouldn't display this message at all. Else the user may wonder which bug was concerned, especially if the user is not in the time tracking group and has no idea what this "hours left" thing is. I think it would be fine to fix it before we release 3.1.1.
Flags: blocking3.1.1?
Sure. Easy to fix.
Flags: blocking3.1.1? → blocking3.1.1+
Attached patch patch, v1Splinter Review
This fix restores the behavior of Bugzilla 3.0, i.e. the "remaining_time_zeroed" message is displayed only if the remaining time of at least one bug being changed was greater than 0 *and* the user belongs to the timetracking group. If you don't belong to the timetracking group, you are never informed about this change, which is definitely the correct behavior.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #274266 - Flags: review?(mkanat)
Comment on attachment 274266 [details] [diff] [review]
patch, v1

>Index: Bugzilla/Bug.pm
>+            $bug->_zero_remaining_time;
>+            $vars->{'message'} = "remaining_time_zeroed"
>+              if Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'});

  Does that work even when there's no timetrackinggroup?

>@@ -2038,8 +2043,11 @@ sub check_status_change_triggers {
>         if ($action ne 'change_resolution') {
>             foreach my $b (@$bugs) {
>                 if ($b->bug_status ne $action) {
>+                    # Note that 0.00 is *true* for Perl!

  Ohhh...we should make Bugzilla::Object do something to make numeric fields more "numeric". That's for another bug, though.

  Looks good, generally.
Attachment #274266 - Flags: review?(mkanat) → review+
(In reply to comment #3)
Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'});
> 
>   Does that work even when there's no timetrackinggroup?

Yes, because this param is always defined, but is blank if not set. And ->in_group() is clever enough to handle it correctly.
Flags: approval+
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.196; previous revision: 1.195
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Blocks: 395603
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: