Last Comment Bug 25521 - Keyword field in new bug entry
: Keyword field in new bug entry
Status: RESOLVED FIXED
enter_bug
:
Product: Bugzilla
Classification: Server Software
Component: Creating/Changing Bugs (show other bugs)
: 2.10
: All All
: P2 normal with 2 votes (vote)
: Bugzilla 2.18
Assigned To: Jeff Hedlund
: default-qa
Mentors:
: 27384 28345 40752 70268 95196 140921 (view as bug list)
Depends on: 103953
Blocks: 16647 65965 86547 newbug
  Show dependency treegraph
 
Reported: 2000-01-28 11:40 PST by leger
Modified: 2012-12-18 20:46 PST (History)
19 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
unified diff against bugzilla TOT implementing keywords on the bug entry page (3.33 KB, patch)
2001-03-08 12:59 PST, Daniel A. Steffen
no flags Details | Diff | Splinter Review
Rough patch. (7.88 KB, patch)
2001-06-23 01:47 PDT, Matthew Tuck [:CodeMachine]
no flags Details | Diff | Splinter Review
patch v.3 (2.11 KB, patch)
2002-02-22 12:53 PST, Jeff Hedlund
gerv: review-
Details | Diff | Splinter Review
Patch v.4 (2.68 KB, patch)
2002-02-25 00:56 PST, Jeff Hedlund
no flags Details | Diff | Splinter Review
patch v.5 (2.20 KB, patch)
2002-07-31 11:44 PDT, Jeff Hedlund
bbaetz: review-
Details | Diff | Splinter Review
patch v.6 (2.41 KB, patch)
2002-08-01 07:31 PDT, Jeff Hedlund
gerv: review-
Details | Diff | Splinter Review
patch v.7 (2.32 KB, patch)
2002-09-09 23:11 PDT, Jeff Hedlund
gerv: review+
gerv: review+
Details | Diff | Splinter Review

Description leger 2000-01-28 11:40:02 PST
terry-

Can you make it so the keyword field is available to info entry in the 
http://bugzilla.mozilla.org/enter_bug.cgi page.

This was the eng could add "helpwanted" or whatever when writing the bug. 

thanks!
Comment 1 leger 2000-02-04 04:43:48 PST
terry, more engineers are asking for this, can you do when you get a chance..ok?
Comment 2 Terry Weissman 2000-02-04 05:30:15 PST
The bug entry form is one that we try to keep *simple*.  I am very very
reluctant to add new fields there.
Comment 3 Terry Weissman 2000-02-11 09:52:45 PST
*** Bug 27384 has been marked as a duplicate of this bug. ***
Comment 4 Matthew Tuck [:CodeMachine] 2000-02-21 15:12:36 PST
*** Bug 28345 has been marked as a duplicate of this bug. ***
Comment 5 Matthew Paul Thomas 2000-03-06 04:29:02 PST
*** Bug 28345 has been marked as a duplicate of this bug. ***
Comment 6 Matthew Paul Thomas 2000-03-06 04:35:27 PST
In bug 28345, I suggested that the Keywords field be available when reporting a 
new bug, but only for those users who have change-all-aspects-of-any-bug 
permissions. That way, engineers and QA people get access to the field, and 
novice bug reporters don't. Problem solved.
Comment 7 Matthew Tuck [:CodeMachine] 2000-03-07 00:18:08 PST
This is really a feature regression over description/whiteboard flags, so I
wouldn't describe it as a new field as such.
Comment 8 Sebastian Späth 2000-03-08 07:40:26 PST
Adding a crasher bug without being able to mark it as such in the keywords at 
the first pass is *really* hard. I agree do not add it to the new form to keep 
it simple, but add it to the advanced form (or have it only when reporter has 
"advanced" rights)
Comment 9 Matthew Tuck [:CodeMachine] 2000-03-09 03:24:37 PST
See the super dooper new bug #31144 for a proposal which would allow this and
more.
Comment 10 Terry Weissman 2000-04-13 07:31:12 PDT
tara@tequilarista.org is the new owner of Bugzilla and Bonsai.  (For details,
see my posting in netscape.public.mozilla.webtools,
news://news.mozilla.org/38F5D90D.F40E8C1A%40geocast.com .)
Comment 11 leger 2000-09-07 02:43:33 PDT
Updating QA Contact
Comment 12 Jesse Ruderman 2000-09-30 21:06:52 PDT
*** Bug 40752 has been marked as a duplicate of this bug. ***
Comment 13 Matthew Tuck [:CodeMachine] 2000-12-09 00:47:01 PST
I don't particularly see why we can't add stuff to the new bug entry like so:

New Bug Entry

.... beginner stuff ...

[ Submit Bug ]

----- Anything below this line is optional and can be ignored by novice Bugzilla
users. -----

.... advanced stuff .....

[ Submit Bug ]
Comment 14 Dave Miller [:justdave] (justdave@bugzilla.org) 2001-02-26 19:22:51 PST
*** Bug 70268 has been marked as a duplicate of this bug. ***
Comment 15 timeless 2001-02-26 22:06:41 PST
if i wrote a patch, would it be rejected?
Comment 16 Daniel A. Steffen 2001-03-08 12:59:04 PST
Created attachment 27144 [details] [diff] [review]
unified diff against bugzilla TOT implementing keywords on the bug entry page
Comment 17 timeless 2001-03-08 14:39:30 PST
cool. hrm, can we have someone research the pro/cons of using a multiselect 
listbox instead of an edit field?
Comment 18 Matthew Tuck [:CodeMachine] 2001-04-20 04:36:46 PDT
Personally, I wouldn't approve this patch without creating a new advanced entry
section that newbies don't have to worry about, as I have outlined.  We have
various fields that people want to add here as well.  We could probably move the
assignee into this section as well.

I have two problems with a listbox.  Firstly, on an installation with lots of
keywords, it's really hard to see what has been selected (you might not be sure
what you did if you lose your way).  And secondly, it's inconsistent with the
bug page.
Comment 19 Matthew Tuck [:CodeMachine] 2001-06-23 01:43:37 PDT
OK, I'm about to attach my proposed patch for this, separating the enter_bug
page into two halves.  I'm not an experienced Bugzilla coder, so beware:

My indentation is probably backwards.
If I kept the table tags balanced it's a minor miracle.
The button list is repeated but is not in a Sub.  Same with some keyword code in
post_bug.cgi lifted from process_bug.cgi.
The layout is probably wrong with certain combinations of fields on.
You may disagree about what should be in the "advanced" section.
We may want to add an option such that certain installations would not get the
message indicating that bug reporters can ignore the advanced section, for
example if all of their users are well trained.
And let's not forget it will fry your hard drive.

So in summary, if you put this patch on your production system, you're likely to
get what you deserve, mmkay?
Comment 20 Matthew Tuck [:CodeMachine] 2001-06-23 01:47:40 PDT
Created attachment 39797 [details] [diff] [review]
Rough patch.
Comment 21 Dave Miller [:justdave] (justdave@bugzilla.org) 2001-08-13 22:10:15 PDT
*** Bug 95196 has been marked as a duplicate of this bug. ***
Comment 22 Zach Lipton [:zach] 2001-08-25 17:49:01 PDT
moving
Comment 23 Keith Kemp 2001-09-14 04:33:06 PDT
*** Bug 99567 has been marked as a duplicate of this bug. ***
Comment 24 Gervase Markham [:gerv] 2001-10-14 17:49:27 PDT
I'm templatising enter_bug.cgi. I may be able to do this at the same time.

Gerv
Comment 25 Dave Miller [:justdave] (justdave@bugzilla.org) 2001-11-17 18:23:03 PST
We are currently trying to wrap up Bugzilla 2.16.  We are now close enough to
release time that anything that wasn't already ranked at P1 isn't going to make
the cut.  Thus this is being retargetted at 2.18.  If you strongly disagree with
this retargetting, please comment, however, be aware that we only have about 2
weeks left to review and test anything at this point, and we intend to devote
this time to the remaining bugs that were designated as release blockers.
Comment 26 Gervase Markham [:gerv] 2002-02-04 13:24:16 PST
Anyone who cares about this should feel free to produce a patch for the new
templatised version.

Gerv
Comment 27 Jeff Hedlund 2002-02-22 12:53:07 PST
Created attachment 70967 [details] [diff] [review]
patch v.3

Updated patch as requested from Gerv.

I did not add "status whiteboard" to the bug entry as "Rough Patch" did, since
that doesn't seem to be a part of this bug.
Comment 28 Andreas Franke (gone) 2002-02-22 14:49:00 PST
     $zz = @::legal_severity;
+        $zz = @::legal_keywords;
     $zz = %::target_milestone;

Is this an evil tab? :-)
Comment 29 Gervase Markham [:gerv] 2002-02-23 02:27:49 PST
Comment on attachment 70967 [details] [diff] [review]
patch v.3

>+# cut & paste from process_bug, better to reuse somehow?

No - because it's going to be different. See below :-)

>+my @keywordlist;
>+my %keywordseen;
>+
>+if ($::FORM{'keywords'}) {
>+  foreach my $keyword (split(/[\s,]+/, $::FORM{'keywords'})) {
>+    if ($keyword eq '') {
>+	   next;
>+	 }
>+	 my $i = GetKeywordIdFromName($keyword);
>+	 if (!$i) {
>+	   PuntTryAgain("Unknown keyword named <code>" .
>+	   				  html_quote($keyword) . "</code>. " .
>+	                 "<P>The legal keyword names are " .
>+				        "<A HREF=describekeywords.cgi>" .
>+				        "listed here</A>.");

I think that, for entering bugs, we should just silently ignore keywords which
aren't keywords. This is much nicer behaviour than slapping the user round the
face with their lack of knowledge. You see, I can see people filling this in
with "helpful" key words about their problem, which Bugzilla won't recognise
most of.

>+    }
>+	 if (!$keywordseen{$i}) {
>+	   push(@keywordlist, $i);
>+	   $keywordseen{$i} = 1;

You make @keywordlist, and never use it. You only need %keywordseen.

>+foreach my $keyword (keys %keywordseen) {
>+	 SendSQL("insert into keywords (bug_id, keywordid) values ($id, $keyword)");

Nit: please capitalise MySQL keywords - it makes the SQL easier to read.

Gerv
Comment 30 Bradley Baetz (:bbaetz) 2002-02-23 02:40:14 PST
>I think that, for entering bugs, we should just silently ignore keywords which
>aren't keywords. This is much nicer behaviour than slapping the user round the
>face with their lack of knowledge. You see, I can see people filling this in
>with "helpful" key words about their problem, which Bugzilla won't recognise
>most of.

I disagree. Typo's happen, + you get the problem of people typing stuff in, and
it magically vanishing. You can't change keywords unless you have editbugs, so
just require it for this, too. See mpt's comment #6.
Comment 31 Gervase Markham [:gerv] 2002-02-23 06:41:00 PST
Mpt is right - please implement his solution :-) A good name for the template
variable is "canedit".

Gerv
Comment 32 Jeff Hedlund 2002-02-25 00:56:32 PST
Created attachment 71286 [details] [diff] [review]
Patch v.4

removed the evil tab
user must be in 'editbugs' group
this patch also includes patch from bug 127318 to enable the above fix
other code cleanup as suggested
Comment 33 Myk Melez [:myk] [@mykmelez] 2002-02-25 01:26:08 PST
Reassigning to patch author.
Comment 34 xyzzy 2002-04-29 08:11:09 PDT
*** Bug 140921 has been marked as a duplicate of this bug. ***
Comment 35 Jeff Hedlund 2002-07-31 11:44:15 PDT
Created attachment 93446 [details] [diff] [review]
patch v.5

New patch for against the tip, should work fine patching against 2.16 as well.
Comment 36 Bradley Baetz (:bbaetz) 2002-07-31 16:21:34 PDT
Comment on attachment 93446 [details] [diff] [review]
patch v.5

If an invalid keyword is entered, then bits of the bug will be submitted anyway
- see bug 154036.

You need to move the checks up higher in the routine.
Comment 37 Jeff Hedlund 2002-08-01 07:31:02 PDT
Created attachment 93569 [details] [diff] [review]
patch v.6

Moved keyword validity checks before any SQL INSERTs
Comment 38 Gervase Markham [:gerv] 2002-08-12 00:43:53 PDT
Comment on attachment 93569 [details] [diff] [review]
patch v.6

>+# Check for valid keywords and create list of keywords to be added to db
>+# (validity routine copied from process_bug.cgi)

Can we not factor this out, then?

>+my @keywordlist;
>+my %keywordseen;
>+
>+if ($::FORM{'keywords'}) {
>+    foreach my $keyword (split(/[\s,]+/, $::FORM{'keywords'})) {
>+        if ($keyword eq '') {
>+           next;
>+        }
>+        my $i = GetKeywordIdFromName($keyword);
>+        if (!$i) {
>+            ThrowUserError("Unknown keyword named <code>" . html_quote($keyword)
>+                           .
>+                           "</code>. <p>The legal keyword names are
>+                           <a href=\"describekeywords.cgi\">listed here</a></p>
>+                           .");

Please use the new API for ThrowUserError: 
$vars->{'keyword'} = $keyword;
ThrowUserError("unknown_keyword");
And then put the error in global/messages.html.tmpl .

>+  [% IF UserInGroup('editbugs') %]
>+    <tr>
>+      <td align="right" valign="top">
>+        <strong>
>+          <a href="describekeywords.cgi">Keywords:</a>

Nit: The colon shouldn't be linked.

As it stands, the UI is protected with "editbugs" but the process_bug is not -
so people without this permission could add keywords by hacking the URL.

Gerv
Comment 39 Bradley Baetz (:bbaetz) 2002-08-12 02:27:04 PDT
Factoring out the code really means removing post_bug and using process_bug
instead. Theres not much factoring out which can be done without doing that too
(or having the two files look virtually alike)
Comment 40 Gervase Markham [:gerv] 2002-08-15 00:19:34 PDT
bbaetz: is there a plan to combine post_bug and process_bug? Or have some common
module?

Gerv
Comment 41 Bradley Baetz (:bbaetz) 2002-08-15 02:00:09 PDT
I want there to be such a plan :) Its a prereq for any sensible working email
bug submission, really.

My point was that that issue shouldn't hold this patch up.
Comment 42 Jeff Hedlund 2002-09-09 23:11:59 PDT
Created attachment 98551 [details] [diff] [review]
patch v.7

Implements changes and brings up to date to current CVS.
Comment 43 Gervase Markham [:gerv] 2002-09-13 15:28:03 PDT
Comment on attachment 98551 [details] [diff] [review]
patch v.7

2xr=gerv. This needed a "colspan=3" on the <td>, but was otherwise OK.

Gerv
Comment 44 Gervase Markham [:gerv] 2002-09-13 15:30:34 PDT
Fixed. Finally :-)

Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.64; previous revision: 1.63
done
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v
 <--  create.html.tmpl
new revision: 1.12; previous revision: 1.11
done

Gerv
Comment 45 dan johnson 2003-05-07 11:51:05 PDT
I just upgraded our version of Bugzilla from 2.10 to 2.16.3 and I don't see 
this fix in.  Is it supposed to be?  Is there anything I need to do to turn it 
on?
Comment 46 Dave Miller [:justdave] (justdave@bugzilla.org) 2003-05-07 12:01:37 PDT
That was fixed in 2.17.1.  You'll need to upgrade again if you want it.

Note You need to log in before you can comment on or make changes to this bug.