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

This commit is contained in:
lpsolit%gmail.com 2007-02-06 14:57:01 +00:00
Родитель 6a6773a24f
Коммит c995b2be25
1 изменённых файлов: 27 добавлений и 17 удалений

Просмотреть файл

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