Last Comment Bug 734997 - The 'take' link for the assignee field doesn't work when usemenuforusers is turned on
: The 'take' link for the assignee field doesn't work when usemenuforusers is t...
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Creating/Changing Bugs (show other bugs)
: 4.2
: All All
: -- normal (vote)
: Bugzilla 4.2
Assigned To: Frédéric Buclin
: default-qa
:
Mentors:
Depends on: 626658
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-12 12:55 PDT by Mark Clements
Modified: 2012-04-11 08:04 PDT (History)
2 users (show)
LpSolit: approval+
LpSolit: approval4.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (3.48 KB, patch)
2012-04-05 10:29 PDT, Frédéric Buclin
glob: review+
Details | Diff | Splinter Review

Description Mark Clements 2012-03-12 12:55:53 PDT
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

(show_bug.cgi) 

>  Assigned To: 	Person A (edit) (take) 

I loaded up a bug that was assigned to another user, and clicked the 'take' link beside the current assignee name (as shown above).



Actual results:

The behaviour seems to be identical to if you select 'edit'.

However, I noticed that the 'set_default_assignee' checkbox is being set to my e-mail address, so I suspect that there is a bit of JavaScript logic that contains a naming error somewhere.


Expected results:

It should have behaved like 'edit', but with the additional effect of changing the assignee to be me.

Note that I have some custom templates, but I temporarily disabled them by renaming 'custom' to 'custom-temp' so the built-in templates were used, and behaviour is still as described.
Comment 1 Frédéric Buclin 2012-03-12 13:00:24 PDT
(In reply to Mark Clements from comment #0)
> However, I noticed that the 'set_default_assignee' checkbox is being set to
> my e-mail address, so I suspect that there is a bit of JavaScript logic that
> contains a naming error somewhere.

A checkbox cannot contain an email address. It's just a checkbox. Your description is pretty confusing. If your email address appears in the Assignee field, then the bug is assigned to you.
Comment 2 Mark Clements 2012-03-12 15:11:54 PDT
(In reply to Frédéric Buclin from comment #1)
> (In reply to Mark Clements from comment #0)
> > However, I noticed that the 'set_default_assignee' checkbox is being set to
> > my e-mail address, so I suspect that there is a bit of JavaScript logic that
> > contains a naming error somewhere.
> 
> A checkbox cannot contain an email address. It's just a checkbox. Your
> description is pretty confusing. If your email address appears in the
> Assignee field, then the bug is assigned to you.

Obviously.

Apologies if the description confused you.

The relevant part of the form contains two input fields:
* A select box with the id 'assigned_to'
* A checkbox with the id 'set_default_assignee'

Both are hidden on form load, and are shown when you click either 'edit' or 'take'.

In addition, 'take' is setting the checkbox to my e-mail address.

What it *should* be doing is setting the select box to my e-mail address.

Please test before resolving as invalid.
Comment 3 Frédéric Buclin 2012-03-12 15:18:59 PDT
(In reply to Mark Clements from comment #2)
> The relevant part of the form contains two input fields:
> * A select box with the id 'assigned_to'

Select box? You have usemenuforusers turned on?


> In addition, 'take' is setting the checkbox to my e-mail address.

Again, a checkbox cannot contain an email address.


> Please test before resolving as invalid.

I tested, but you didn't give all the information. :)
Comment 4 Mark Clements 2012-03-13 01:02:47 PDT
(In reply to Frédéric Buclin from comment #3)
> (In reply to Mark Clements from comment #2)
> > The relevant part of the form contains two input fields:
> > * A select box with the id 'assigned_to'
> 
> Select box? You have usemenuforusers turned on?

Ah - yes.  I'd forgotten about that.

> > In addition, 'take' is setting the checkbox to my e-mail address.
> 
> Again, a checkbox cannot contain an email address.
> 

In theory.  In practice, yes it does.  If I examine the element in Firebug, its value is my e-mail address.  Not sure what would happen if I submitted with that value present though (whether it converts it to boolean or submits it as-is).

Of course, that could be a bug in Firebug...

> > Please test before resolving as invalid.
> 
> I tested, but you didn't give all the information. :)

In that case, I apologise.  Keep up the good work! :-)
Comment 5 Frédéric Buclin 2012-03-13 17:15:57 PDT
I can reproduce the issue, so confirmed.
Comment 6 Frédéric Buclin 2012-04-05 10:29:40 PDT
Created attachment 612596 [details] [diff] [review]
patch, v1

Asking dkl as he implemented the (take) link. I had to fix showEditableField() to accept both an <input> or a <select> field.
Comment 7 Byron Jones ‹:glob› [PTO until 2016-10-10] 2012-04-11 06:20:07 PDT
Comment on attachment 612596 [details] [diff] [review]
patch, v1

r=glob
Comment 8 Frédéric Buclin 2012-04-11 08:04:47 PDT
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified js/field.js
Committed revision 8179.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified js/field.js
Committed revision 8065.

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