diff --git a/mozilla/webtools/bugzilla/defparams.pl b/mozilla/webtools/bugzilla/defparams.pl index 640f92b970b..e6cb16ac87a 100644 --- a/mozilla/webtools/bugzilla/defparams.pl +++ b/mozilla/webtools/bugzilla/defparams.pl @@ -843,6 +843,14 @@ Reason: %reason% default => 'this may indicate a bug in your browser.' }, + { + name => 'commentoncreate', + desc => 'If this option is on, the user needs to enter a description ' . + 'when entering a new bug', + type => 'b', + default => 0 + }, + { name => 'commentonaccept', desc => 'If this option is on, the user needs to enter a short comment if ' . diff --git a/mozilla/webtools/bugzilla/post_bug.cgi b/mozilla/webtools/bugzilla/post_bug.cgi index 315ff3a995a..dbc102d3eef 100755 --- a/mozilla/webtools/bugzilla/post_bug.cgi +++ b/mozilla/webtools/bugzilla/post_bug.cgi @@ -76,6 +76,10 @@ my $format = GetFormat("bug/create/comment", $::FORM{'format'}, "txt"); $template->process($format->{'template'}, $vars, \$comment) || ThrowTemplateError($template->error()); +# Check that if required a description has been provided +if (Param("commentoncreate") && !trim($::FORM{'comment'})) { + ThrowUserError("description_required"); +} ValidateComment($comment); my $product = $::FORM{'product'}; diff --git a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl index 1aec9b4f6ee..37eb7bd5b26 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl @@ -150,6 +150,10 @@ [% title = "Dependency Loop Detected" %] You can't make [% terms.abug %] blocked or dependent on itself. + [% ELSIF error == "description_required" %] + [% title = "Description Required" %] + You must provide a description of the [% terms.bug %]. + [% ELSIF error == "dupe_invalid_bug_id" %] [% title = BLOCK %]Valid [% terms.Bug %] Number Required[% END %] You must specify a valid [% terms.bug %] number of which this