diff options
author | David Lawrence <dkl@mozilla.com> | 2014-03-20 21:57:18 +0100 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-03-20 21:57:18 +0100 |
commit | 99457cc8631ec71dcacb4e79b1597c0f8b9abd25 (patch) | |
tree | 2886187dfe1f10b5cf210a798126d19fe024f73d /Bugzilla/Bug.pm | |
parent | 076af7dcd9541e0ff7b2e1895759cedf156a5c39 (diff) | |
download | bugzilla-99457cc8631ec71dcacb4e79b1597c0f8b9abd25.tar.gz bugzilla-99457cc8631ec71dcacb4e79b1597c0f8b9abd25.tar.xz |
Bug 986124 - backport upstream bug 513212 to bmo/4.2 to add the ability to add see_also values in enter_bug.cgi and Bug.create
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index a99dfaf85..f19803e1c 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -665,6 +665,7 @@ sub create { my $blocked = delete $params->{blocked}; my $keywords = delete $params->{keywords}; my $creation_comment = delete $params->{comment}; + my $see_also = delete $params->{see_also}; # We don't want the bug to appear in the system until it's correctly # protected by groups. @@ -727,6 +728,25 @@ sub create { } } + # Insert any see_also values + if ($see_also) { + my $see_also_array = $see_also; + if (!ref $see_also_array) { + $see_also = trim($see_also); + $see_also_array = [ split(/[\s,]+/, $see_also) ]; + } + foreach my $value (@$see_also_array) { + $bug->add_see_also($value); + } + foreach my $see_also (@{ $bug->see_also }) { + $see_also->insert_create_data($see_also); + } + foreach my $ref_bug (@{ $bug->{_update_ref_bugs} || [] }) { + $ref_bug->update(); + } + delete $bug->{_update_ref_bugs}; + } + # Comment #0 handling... # We now have a bug id so we can fill this out |