281
return $err;
281
return $err;
284
# Converts and returns the input data as an array.
288
$value = [$value] if !ref($value);
284
###############################################################################
292
###############################################################################
285
# XML Handlers #
293
# XML Handlers #
286
###############################################################################
294
###############################################################################
565
$comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n";
573
$comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n";
566
if ( defined $bug_fields{'dependson'} ) {
574
if ( defined $bug_fields{'dependson'} ) {
567
$comments .= "This bug depended on bug(s) " .
575
$comments .= "This bug depended on bug(s) " .
568
join(' ', @{$bug_fields{'dependson'}}) . ".\n";
576
join(' ', _to_array($bug_fields{'dependson'})) . ".\n";
570
if ( defined $bug_fields{'blocked'} ) {
578
if ( defined $bug_fields{'blocked'} ) {
571
$comments .= "This bug blocked bug(s) " .
579
$comments .= "This bug blocked bug(s) " .
572
join(' ', @{$bug_fields{'blocked'}}) . ".\n";
580
join(' ', _to_array($bug_fields{'blocked'})) . ".\n";
575
# Now we process each of the fields in turn and make sure they contain
583
# Now we process each of the fields in turn and make sure they contain
1058
} elsif ($field->type == FIELD_TYPE_MULTI_SELECT) {
1066
} elsif ($field->type == FIELD_TYPE_MULTI_SELECT) {
1059
my @legal_values;
1067
my @legal_values;
1060
foreach my $item (@$value) {
1068
foreach my $item (_to_array($value)) {
1061
my $is_well_formed = check_field($custom_field, $item, undef, ERR_LEVEL);
1069
my $is_well_formed = check_field($custom_field, $item, undef, ERR_LEVEL);
1062
if ($is_well_formed) {
1070
if ($is_well_formed) {
1063
push(@legal_values, $item);
1071
push(@legal_values, $item);
1116
if ( defined $bug_fields{'cc'} ) {
1124
if ( defined $bug_fields{'cc'} ) {
1117
my %ccseen;
1125
my %ccseen;
1118
my $sth_cc = $dbh->prepare("INSERT INTO cc (bug_id, who) VALUES (?,?)");
1126
my $sth_cc = $dbh->prepare("INSERT INTO cc (bug_id, who) VALUES (?,?)");
1119
foreach my $person (@{$bug_fields{'cc'}}) {
1127
foreach my $person (_to_array($bug_fields{'cc'})) {
1120
next unless $person;
1128
next unless $person;
1121
my $uid;
1129
my $uid;
1122
if ($uid = login_to_id($person)) {
1130
if ($uid = login_to_id($person)) {