summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-02-06 23:57:01 +0100
committerlpsolit%gmail.com <>2007-02-06 23:57:01 +0100
commit121badd2da4e4f4528d29948dd8ca6d44eddfe8e (patch)
tree70f08c6552d27b8560d19af51f1e98370a371f67
parentef1b59313347dd8e2b117ebf55520dba7e37d885 (diff)
downloadbugzilla-121badd2da4e4f4528d29948dd8ca6d44eddfe8e.tar.gz
bugzilla-121badd2da4e4f4528d29948dd8ca6d44eddfe8e.tar.xz
Bug 348282: importxml.pl throws Bugzilla::Bug::ValidateTime warnings if the time value is not defined and param timetrackinggroup defined - Patch by Guzmán Brasó <gbn@hqso.net> r/a=LpSolit
-rwxr-xr-ximportxml.pl44
1 files changed, 27 insertions, 17 deletions
diff --git a/importxml.pl b/importxml.pl
index 6dff2af7f..f0fd0d8ec 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -791,26 +791,36 @@ sub process_bug {
|| undef;
push( @values, $date );
push( @query, "deadline" );
- eval {
- Bugzilla::Bug::ValidateTime($bug_fields{'estimated_time'}, "e");
- };
- if (!$@){
- push( @values, $bug_fields{'estimated_time'} );
- push( @query, "estimated_time" );
+ if ( defined $bug_fields{'estimated_time'} ) {
+ eval {
+ Bugzilla::Bug::ValidateTime($bug_fields{'estimated_time'}, "e");
+ };
+ if (!$@){
+ push( @values, $bug_fields{'estimated_time'} );
+ push( @query, "estimated_time" );
+ }
}
- eval {
- Bugzilla::Bug::ValidateTime($bug_fields{'remaining_time'}, "r");
- };
- if (!$@){
- push( @values, $bug_fields{'remaining_time'} );
- push( @query, "remaining_time" );
+ if ( defined $bug_fields{'remaining_time'} ) {
+ eval {
+ Bugzilla::Bug::ValidateTime($bug_fields{'remaining_time'}, "r");
+ };
+ if (!$@){
+ push( @values, $bug_fields{'remaining_time'} );
+ push( @query, "remaining_time" );
+ }
}
- eval {
- Bugzilla::Bug::ValidateTime($bug_fields{'actual_time'}, "a");
- };
- if ($@){
+ if ( defined $bug_fields{'actual_time'} ) {
+ eval {
+ Bugzilla::Bug::ValidateTime($bug_fields{'actual_time'}, "a");
+ };
+ if ($@){
+ $bug_fields{'actual_time'} = 0.0;
+ $err .= "Invalid Actual Time. Setting to 0.0\n";
+ }
+ }
+ else {
$bug_fields{'actual_time'} = 0.0;
- $err .= "Invalid Actual Time. Setting to 0.0\n";
+ $err .= "Actual time not defined. Setting to 0.0\n";
}
}