diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-25 23:00:31 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-25 23:00:31 +0100 |
commit | cd37b2c8fdb4580fd49b9a75c3d38236db898b4c (patch) | |
tree | 9db58da9575ceb9155554e899a43926bc94bee1a | |
parent | f80035ed6dcd4517dbcff214629bef5fdf5897fb (diff) | |
download | bugzilla-cd37b2c8fdb4580fd49b9a75c3d38236db898b4c.tar.gz bugzilla-cd37b2c8fdb4580fd49b9a75c3d38236db898b4c.tar.xz |
Bug 843879 - Project Kickoff Form: Several dependent bugs weren't created from form
-rw-r--r-- | extensions/MozProjectReview/Extension.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/extensions/MozProjectReview/Extension.pm b/extensions/MozProjectReview/Extension.pm index 02621ff7d..0f5c2b735 100644 --- a/extensions/MozProjectReview/Extension.pm +++ b/extensions/MozProjectReview/Extension.pm @@ -267,15 +267,16 @@ sub _file_child_bug { $template->process($full_template, $template_vars, \$comment) || ThrowTemplateError($template->error()); $bug_data->{comment} = $comment; - $new_bug = Bugzilla::Bug->create($bug_data); - $parent_bug->set_all({ dependson => { add => [ $new_bug->bug_id ] }}); - Bugzilla::BugMail::Send($new_bug->id, { changer => Bugzilla->user }); + if ($new_bug = Bugzilla::Bug->create($bug_data)) { + $parent_bug->set_all({ dependson => { add => [ $new_bug->bug_id ] }}); + Bugzilla::BugMail::Send($new_bug->id, { changer => Bugzilla->user }); + } }; - if ($@) { + if ($@ || !$new_bug) { push(@$dep_comment, "Error creating $template_suffix review bug"); - push(@$dep_errors, "$template_suffix : $@"); + push(@$dep_errors, "$template_suffix : $@") if $@; } - if ($new_bug) { + else { push(@$dep_comment, "Bug " . $new_bug->id . " - " . $new_bug->short_desc); } } |