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

RESOLVED FIXED in Bugzilla 3.2

Status

()

Bugzilla
Creating/Changing Bugs
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({regression})

Bugzilla 3.2
regression
Dependency tree / graph
Bug Flags:
approval +
blocking3.1.1 +

Details

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
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?

Comment 1

11 years ago
Sure. Easy to fix.
Flags: blocking3.1.1? → blocking3.1.1+
(Assignee)

Comment 2

11 years ago
Created attachment 274266 [details] [diff] [review]
patch, v1

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 3

11 years ago
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+
(Assignee)

Comment 4

11 years ago
(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+
(Assignee)

Comment 5

11 years ago
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
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

11 years ago
Blocks: 395603
You need to log in before you can comment on or make changes to this bug.