Closed Bug 213679 Opened 21 years ago Closed 21 years ago

There should be a 'commentoncreate' parameter

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: dswegen, Assigned: dswegen)

Details

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030704 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030704 Mozilla Firebird/0.6

At the moment there is no way of enforcing a policy of having to provide an
initial comment on a bug. This is odd as there are parameters to enforce
comments on virtually every other bug operation.

Reproducible: Always

Steps to Reproduce:
1. Create a new bug, don't provide a comment
2.
3.

Actual Results:  
Bug was accepted

Expected Results:  
If the option had been set it should have shown an error screen prompting for a
comment.

This feature doesn't exist in 2.17.1
If the descriptionrequired param is set a user error will be thrown if no
comment is given when submitting a bug.
Attachment #134308 - Flags: review?(myk)
Comment on attachment 134308 [details] [diff] [review]
Patch that provides "description required" option

>diff -ur --exclude CVS /scratch/bugzilla-hacking/bugzilla.cvs.orig/defparams.pl 

>+   name => 'descriptionrequired',

Please rename this to commentoncreate for consistency with the other related
parameters.

>diff -ur --exclude CVS /scratch/bugzilla-hacking/bugzilla.cvs.orig/post_bug.cgi 

>+# Check that if required a description has been provided
>+if (Param("descriptionrequired")) {
>+    if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
>+        ThrowUserError("description_required");
>+    }
>+}

Nit: this could be simpler as just:

if (Param("descriptionrequired") && !trim($::FORM{'comment'})) ...

trim() will just return undefined if its argument is undefined, otherwise it'll
strip preceding and succeeding spaces, so this test is equivalent to separate
checks for definition and spaciness.
Attachment #134308 - Flags: review?(myk) → review-
Attached patch Updated comment on create patch (obsolete) — Splinter Review
Attachment #134308 - Attachment is obsolete: true
Attachment #134387 - Flags: review?(myk)
Why should this be an option?  It should be enforced.  There is no occasion
where an empty comment is appropriate.  You should include something, even if
it's the same as the summary.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.20
I fully agree that allowing empty descriptions is bad policy, but with this
patch I'm simply trying to maintain what seems to be the current policy towards
comments, i.e. make them all optional. The only reason I can see for not making
this an option is for reasons of option bloat. I have no preference either way.
This patch takes Matty's comment into account, and makes create comment
mandatory.
Attachment #134387 - Flags: review?(myk)
Attachment #140066 - Flags: review?(myk)
Comment on attachment 140066 [details] [diff] [review]
Same patch, but without the config option

There are some legitimate reasons to have empty descriptions.  We might want to
automatically duplicate the summary of such bugs in the description (if only to
improve fulltext and comment searches), but we shouldn't force the user to do
so.
Attachment #140066 - Flags: review?(myk)
Comment on attachment 134387 [details] [diff] [review]
Updated comment on create patch

>+   name => 'commentoncreate',
>+   desc => 'If this option is on, the user needs to enter a description ' .
>+           'of the bug',

Nit: of the bug -> when entering a new bug

>+  [% ELSIF error == "description_required" %]
>+    [% title = "Description Required" %]
>+    You must provide a description of the bug before it will be accepted.

Nit: the self-evident and passive phrase "before it will be accepted" seems
clunky and unnecessary.

r=myk
Attachment #134387 - Flags: review+
Flags: approval+
Assignee: myk → dswegen
OS: Linux → All
Hardware: PC → All
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18
Attached patch Checked in patchSplinter Review
Checked in patch (the same with the one that got a+ but with myk's nits fixed
and a "bug" ==> "terms.bug" in order not to set the tree on fire).
Attachment #134387 - Attachment is obsolete: true
Checking in defparams.pl;
/cvsroot/mozilla/webtools/bugzilla/defparams.pl,v  <--  defparams.pl
new revision: 1.124; previous revision: 1.123
done
Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.86; previous revision: 1.85
done
Checking in template/en/default/global/user-error.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl,v
 <--  user-error.html.tmpl
new revision: 1.46; previous revision: 1.45
done
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: