Commit 121badd2 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 348282: importxml.pl throws Bugzilla::Bug::ValidateTime warnings if the time…

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
parent ef1b5931
......@@ -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";
}
}
......
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