]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 180966 - warnings in webserver error log (take 2)
authorbbaetz%student.usyd.edu.au <>
Fri, 22 Nov 2002 09:47:34 +0000 (09:47 +0000)
committerbbaetz%student.usyd.edu.au <>
Fri, 22 Nov 2002 09:47:34 +0000 (09:47 +0000)
r=joel, a=justdave

Bugzilla/User.pm
process_bug.cgi
showdependencytree.cgi

index b12b5e135871b5aa91c764fead33ad8951ff1c13..a45cf09765ed5d59a1a8ff04b34829aad1ccdf2b 100644 (file)
@@ -267,7 +267,7 @@ sub match_field {
         next if !defined($vars->{'mform'}->{$field});
 
         # Skip it if this is a --do_not_change-- field
-        next if $dontchange eq $vars->{'form'}->{$field};
+        next if $dontchange && $dontchange eq $vars->{'form'}->{$field};
 
         # We need to move the query to $raw_field, where it will be split up,
         # modified by the search, and put back into $::FORM and $::MFORM
index 531706582480b247a298af714f1a2c8fbaad9d89..31638b3432c2f92c4d0bebc07bc382cee3bb03dc 100755 (executable)
@@ -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;
index e2e9d52b0ed76de71d6c012cb5a02c6e1e7cdbbd..0508f078bf11f8038587c32a2301a641f4be3364 100755 (executable)
@@ -164,7 +164,7 @@ sub GetBug {
          $bug->{'assignee_email'}) = FetchSQLData();
      }
     
-    $bug->{'open'} = IsOpenedState($bug->{'status'});
+    $bug->{'open'} = $bug->{'exists'} && IsOpenedState($bug->{'status'});
     $bug->{'dependencies'} = [];
     
     return $bug;