summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-07-14 00:47:21 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2010-07-14 00:47:21 +0200
commitd78689415035a705eebddec26b48591b9c68c742 (patch)
treea166fcb85b4254529f01924dbf86c878cd8fcc00 /Bugzilla/Bug.pm
parent12eb7b79859d1ee0be9f237d2b097fc4bf42d2c3 (diff)
downloadbugzilla-d78689415035a705eebddec26b48591b9c68c742.tar.gz
bugzilla-d78689415035a705eebddec26b48591b9c68c742.tar.xz
Bug 578324: The "Hours Worked" field in show_bug.cgi rejects all values passed to it if it would make the Remaining Time negative
r/a=mkanat
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index e28c752df..fce2a1634 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -50,7 +50,7 @@ use Bugzilla::Status;
use Bugzilla::Comment;
use List::MoreUtils qw(firstidx uniq);
-use List::Util qw(min first);
+use List::Util qw(min max first);
use Storable qw(dclone);
use URI;
use URI::QueryParam;
@@ -2627,7 +2627,7 @@ sub add_comment {
# later in set_all. But if they haven't, this keeps remaining_time
# up-to-date.
if ($params->{work_time}) {
- $self->set_remaining_time($self->remaining_time - $params->{work_time});
+ $self->set_remaining_time(max($self->remaining_time - $params->{work_time}, 0));
}
# So we really want to comment. Make sure we are allowed to do so.