Closed Bug 1270479 Opened 4 years ago Closed 4 years ago

Unsetting the needinfo checks the needinfo checkbox

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: dkl)

Details

Steps to reproduce:
1) fill in bug new bug form
2) type in a username in the needinfo box (e.g. :peterbe)
(Note: this neatly checks the needinfo checkbox for me. Good)
3) change your mind, 
3.1) uncheck the needinfo checkbox
3.2) go back to the needinfo and delete the typed in text

Expected result:
When I onBlur from the needinfo input, the checkbox gets UNchecked

Actual result:
When I onBlur from the needinfo input, the checkbox gets checked again
Assignee: ui → nobody
Product: Bugzilla → bugzilla.mozilla.org
QA Contact: default-qa
Version: unspecified → Production
How about when the checkbox is unchecked, the field is cleared?
Flags: needinfo?(peterbe)
(In reply to Dylan William Hardison [:dylan] from comment #1)
> How about when the checkbox is unchecked, the field is cleared?

That I don't know. Might very well be an orthogonal problem.
Flags: needinfo?(peterbe)
Assignee: nobody → dkl
Status: NEW → ASSIGNED
(In reply to Peter Bengtsson [:peterbe] from comment #0)
> Steps to reproduce:
> 1) fill in bug new bug form
> 2) type in a username in the needinfo box (e.g. :peterbe)
> (Note: this neatly checks the needinfo checkbox for me. Good)
> 3) change your mind, 
> 3.1) uncheck the needinfo checkbox
> 3.2) go back to the needinfo and delete the typed in text
> 
> Expected result:
> When I onBlur from the needinfo input, the checkbox gets UNchecked
> 
> Actual result:
> When I onBlur from the needinfo input, the checkbox gets checked again

I can recreate this on the show_bug.cgi page. We do not have a needinfo section on a new bug form. You meant show_bug.cgi right?
Flags: needinfo?(peterbe)
Simple fix.

In jQuery, $('#needinfo_from').val returns a pointer to function val() and not the actual value. Adding () returns the value.
$('#needinfo_from').val(). So before it was always evaluating to true and checking the box.

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   97cc953..32be47b  master -> master

dkl
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Component: User Interface → Extensions: Needinfo
Resolution: --- → FIXED
(In reply to David Lawrence [:dkl] from comment #3)
> (In reply to Peter Bengtsson [:peterbe] from comment #0)
> > Steps to reproduce:
> > 1) fill in bug new bug form
> > 2) type in a username in the needinfo box (e.g. :peterbe)
> > (Note: this neatly checks the needinfo checkbox for me. Good)
> > 3) change your mind, 
> > 3.1) uncheck the needinfo checkbox
> > 3.2) go back to the needinfo and delete the typed in text
> > 
> > Expected result:
> > When I onBlur from the needinfo input, the checkbox gets UNchecked
> > 
> > Actual result:
> > When I onBlur from the needinfo input, the checkbox gets checked again
> 
> I can recreate this on the show_bug.cgi page. We do not have a needinfo
> section on a new bug form. You meant show_bug.cgi right?

Yep.
Flags: needinfo?(peterbe)
This has been pushed to production.

dkl
Component: Extensions: Needinfo → Extensions
You need to log in before you can comment on or make changes to this bug.