From cd37b2c8fdb4580fd49b9a75c3d38236db898b4c Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Mon, 25 Feb 2013 17:00:31 -0500 Subject: Bug 843879 - Project Kickoff Form: Several dependent bugs weren't created from form --- extensions/MozProjectReview/Extension.pm | 13 +++++++------ 1 file 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); } } -- cgit v1.2.3-24-g4f1b