]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 607909: Hours worked / work_time is marked as changing when commenting even when...
authorChristian Legnitto <clegnitto@mozilla.com>
Wed, 3 Nov 2010 15:33:30 +0000 (16:33 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 3 Nov 2010 15:33:30 +0000 (16:33 +0100)
r/a=LpSolit

Bugzilla/Bug.pm
Bugzilla/Comment.pm

index e005b05c5600008bec594e964cbf70d5b1171aee..f5b0928008c87f262c11f9364874bd1f939d251c 100644 (file)
@@ -895,8 +895,8 @@ sub update {
         # timestamp.
         $comment->{bug_when} = $delta_ts;
         $comment = Bugzilla::Comment->insert_create_data($comment);
-        if ($comment->{work_time}) {
-            LogActivityEntry($self->id, "work_time", "", $comment->{work_time},
+        if ($comment->work_time) {
+            LogActivityEntry($self->id, "work_time", "", $comment->work_time,
                 Bugzilla->user->id, $delta_ts);
         }
     }
index e8bdb4e8998f506cfba0b88354a7981a04029e32..7b9e257dfc11ed0956d76bafec69d16475dd16ec 100644 (file)
@@ -113,7 +113,11 @@ sub body        { return $_[0]->{'thetext'};   }
 sub bug_id      { return $_[0]->{'bug_id'};    }
 sub creation_ts { return $_[0]->{'bug_when'};  }
 sub is_private  { return $_[0]->{'isprivate'}; }
-sub work_time   { return $_[0]->{'work_time'}; }
+sub work_time   {
+    # Work time is returned as a string (see bug 607909)
+    return 0 if $_[0]->{'work_time'} + 0 == 0;
+    return $_[0]->{'work_time'};
+}
 sub type        { return $_[0]->{'type'};      }
 sub extra_data  { return $_[0]->{'extra_data'} }