Commit d7868941 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 578324: The "Hours Worked" field in show_bug.cgi rejects all values passed…

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
parent 12eb7b79
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment