diff options
author | mkanat%bugzilla.org <> | 2008-03-26 10:05:19 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2008-03-26 10:05:19 +0000 |
commit | ba10f28c9215b2ebeae7a6620183eec6c4721b35 (patch) | |
tree | 29d629728a6c611448956a9f0e369592ce1e323a /process_bug.cgi | |
parent | 9c41867dba879502b744fce9a588c3bdc284961d (diff) | |
download | bugs-ba10f28c9215b2ebeae7a6620183eec6c4721b35.tar bugs-ba10f28c9215b2ebeae7a6620183eec6c4721b35.tar.gz bugs-ba10f28c9215b2ebeae7a6620183eec6c4721b35.tar.bz2 bugs-ba10f28c9215b2ebeae7a6620183eec6c4721b35.tar.xz bugs-ba10f28c9215b2ebeae7a6620183eec6c4721b35.zip |
Bug 413184: Unify all of the update_ functions in Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 277cbb0fd..ffa06cee3 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -542,19 +542,17 @@ foreach my $bug (@bug_objects) { } } - $bug->update_keywords($timestamp); - - my ($cc_removed) = $bug->update_cc($timestamp); - $cc_removed = [map {$_->login} @$cc_removed]; - - my ($dep_changes) = $bug->update_dependencies($timestamp); - - # Convert the "changes" hash into a list of all the bug ids, then - # convert that into a hash to eliminate duplicates. ("map {@$_}" collapses - # an array of arrays.) - my @all_changed_deps = map { @$_ } @{$dep_changes->{'dependson'}}; - push(@all_changed_deps, map { @$_ } @{$dep_changes->{'blocked'}}); - my %changed_deps = map { $_ => 1 } @all_changed_deps; + # To get a list of all changed dependencies, convert the "changes" arrays + # into a long string, then collapse that string into unique numbers in + # a hash. + my $all_changed_deps = join(', ', @{ $changes->{'dependson'} || [] }); + $all_changed_deps = join(', ', @{ $changes->{'blocked'} || [] }, + $all_changed_deps); + my %changed_deps = map { $_ => 1 } split(', ', $all_changed_deps); + # When clearning one field (say, blocks) and filling in the other + # (say, dependson), an empty string can get into the hash and cause + # an error later. + delete $changed_deps{''}; # $msgs will store emails which have to be sent to voters, if any. my $msgs; @@ -582,10 +580,11 @@ foreach my $bug (@bug_objects) { MessageToMTA($msg); } - my $old_qa = $changes->{'qa_contact'} ? $changes->{'qa_contact'}->[0] : ''; - my $old_own = $changes->{'assigned_to'} ? $changes->{'assigned_to'}->[0] : ''; + my $old_qa = $changes->{'qa_contact'} ? $changes->{'qa_contact'}->[0] : ''; + my $old_own = $changes->{'assigned_to'} ? $changes->{'assigned_to'}->[0] : ''; + my $old_cc = $changes->{cc} ? $changes->{cc}->[0] : ''; $vars->{'mailrecipients'} = { - cc => $cc_removed, + cc => [split(/[\s,]+/, $old_cc)], owner => $old_own, qacontact => $old_qa, changer => Bugzilla->user->login }; |