From: lpsolit%gmail.com <> Date: Wed, 4 Apr 2007 04:55:52 +0000 (+0000) Subject: Bug 368311: Custom field data is not imported into the database from the XML file... X-Git-Tag: bugzilla-3.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce9986e0980ef8635b5f6d58e99167685a3d4590;p=thirdparty%2Fbugzilla.git Bug 368311: Custom field data is not imported into the database from the XML file - Patch by Erik r/a=LpSolit --- diff --git a/importxml.pl b/importxml.pl index f0fd0d8ec5..6e6f4a6191 100755 --- a/importxml.pl +++ b/importxml.pl @@ -22,6 +22,7 @@ # Gregary Hendricks # Vance Baarda # Guzman Braso +# Erik Purins # This script reads in xml bug data from standard input and inserts # a new bug into bugzilla. Everything before the beginning custom_field_names) { + next unless defined($bug_fields{$custom_field}); + my $field = new Bugzilla::Field({name => $custom_field}); + if ($field->type == FIELD_TYPE_FREETEXT) { + push(@query, $custom_field); + push(@values, clean_text($bug_fields{$custom_field})); + } elsif ($field->type == FIELD_TYPE_SINGLE_SELECT) { + my $is_well_formed = check_field($custom_field, scalar $bug_fields{$custom_field}, + undef, ERR_LEVEL); + if ($is_well_formed) { + push(@query, $custom_field); + push(@values, $bug_fields{$custom_field}); + } else { + $err .= "Skipping illegal value \"$bug_fields{$custom_field}\" in $custom_field.\n" ; + } + } else { + $err .= "Type of custom field $custom_field is an unhandled FIELD_TYPE: " . + $field->type . "\n"; + } + } # For the sake of sanitycheck.cgi we do this. # Update lastdiffed if you do not want to have mail sent