summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-03-20 20:55:57 +0100
committerDavid Lawrence <dkl@mozilla.com>2014-03-20 20:55:57 +0100
commit9f18c2a6cf47e328fec681432633fafae46d0be1 (patch)
tree0bc6bac8aec4c772945e66deeceed23e794b75e0 /Bugzilla/Bug.pm
parentca7b39aa66be9b4deea1ead8e6a788025759b80d (diff)
downloadbugzilla-9f18c2a6cf47e328fec681432633fafae46d0be1.tar.gz
bugzilla-9f18c2a6cf47e328fec681432633fafae46d0be1.tar.xz
Bug 513212 - Allow people to set "See Also" when filing/creating/entering a bug on enter_bug.cgi or the Bug.create webservice
r/a=glob
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index f05533d25..b53847790 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -652,6 +652,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.
@@ -715,6 +716,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