diff options
author | bbaetz%student.usyd.edu.au <> | 2002-11-22 09:47:34 +0000 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-11-22 09:47:34 +0000 |
commit | 1e400dc0114d167a38d37842e6165b9c34d7c8d9 (patch) | |
tree | a3748be7fea242befccc5e4c889a9552d6fc7bbc /process_bug.cgi | |
parent | 9973264f52fb44c882d54826df7280d0cff8eaa1 (diff) | |
download | bugs-1e400dc0114d167a38d37842e6165b9c34d7c8d9.tar bugs-1e400dc0114d167a38d37842e6165b9c34d7c8d9.tar.gz bugs-1e400dc0114d167a38d37842e6165b9c34d7c8d9.tar.bz2 bugs-1e400dc0114d167a38d37842e6165b9c34d7c8d9.tar.xz bugs-1e400dc0114d167a38d37842e6165b9c34d7c8d9.zip |
Bug 180966 - warnings in webserver error log (take 2)
r=joel, a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 531706582..31638b343 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -109,6 +109,8 @@ if (defined $::FORM{'dup_id'} && $::FORM{'knob'} eq "duplicate") { ValidateComment($::FORM{'comment'}); +$::FORM{'dontchange'} = '' unless exists $::FORM{'dontchange'}; + # If the bug(s) being modified have dependencies, validate them # and rebuild the list with the validated values. This is important # because there are situations where validation changes the value @@ -730,20 +732,21 @@ if (defined $::FORM{'qa_contact'}) { } # jeff.hedlund@matrixsi.com time tracking data processing: -foreach my $field ("estimated_time", "remaining_time") { - - if (defined $::FORM{$field}) { - my $er_time = trim($::FORM{$field}); - if ($er_time ne $::FORM{'dontchange'}) { - if ($er_time > 99999.99) { - ThrowUserError("value_out_of_range", {field => $field}); - } - if ($er_time =~ /^(?:\d+(?:\.\d*)?|\.\d+)$/) { - DoComma(); - $::query .= "$field = " . SqlQuote($er_time); - } else { - $vars->{'field'} = $field; - ThrowUserError("need_positive_number"); +if (UserInGroup(Param('timetrackinggroup'))) { + foreach my $field ("estimated_time", "remaining_time") { + if (defined $::FORM{$field}) { + my $er_time = trim($::FORM{$field}); + if ($er_time ne $::FORM{'dontchange'}) { + if ($er_time > 99999.99) { + ThrowUserError("value_out_of_range", {field => $field}); + } + if ($er_time =~ /^(?:\d+(?:\.\d*)?|\.\d+)$/) { + DoComma(); + $::query .= "$field = " . SqlQuote($er_time); + } else { + $vars->{'field'} = $field; + ThrowUserError("need_positive_number"); + } } } } @@ -1202,18 +1205,19 @@ foreach my $id (@idlist) { SendSQL("select now()"); $timestamp = FetchOneColumn(); - if ($::FORM{'work_time'} > 99999.99) { + delete $::FORM{'work_time'} unless UserInGroup(Param('timetrackinggroup')); + + if ($::FORM{'work_time'} && $::FORM{'work_time'} > 99999.99) { ThrowUserError("value_out_of_range", {field => 'work_time'}); } - if (defined $::FORM{'comment'} || defined $::FORM{'work_time'}) { - if ($::FORM{'work_time'} != 0 && + if ($::FORM{'comment'} || $::FORM{'work_time'}) { + if ($::FORM{'work_time'} && (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/)) { - ThrowUserError('comment_required'); } else { AppendComment($id, $::COOKIE{'Bugzilla_login'}, $::FORM{'comment'}, - $::FORM{'commentprivacy'}, $timestamp, $::FORM{'work_time'}); - if ($::FORM{'work_time'} != 0) { + $::FORM{'commentprivacy'}, $timestamp, $::FORM{'work_time'}); + if ($::FORM{'work_time'}) { LogActivityEntry($id, "work_time", "", $::FORM{'work_time'}, $whoid, $timestamp); $bug_changed = 1; |