The default bug view has changed. See this FAQ.

userAutocomplete is not compatible with Bugzilla configured to use "local" usernames

RESOLVED FIXED in Bugzilla 4.0

Status

()

Bugzilla
Creating/Changing Bugs
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Randy Reddekopp, Assigned: Randy Reddekopp)

Tracking

Bugzilla 4.0
Bug Flags:
approval +
approval4.0 +
blocking4.0.1 +
testcase ?

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
User-Agent:       Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0b11) Gecko/20100101 Firefox/4.0b11
Build Identifier: 4.0.0

Having bugzilla configured to use local usernames implies that the user accounts created have a username without an email suffix (such as @hotmail.com)

Following recommendations, our company uses the following settings to achieve this configuration:

Administration > Parameters > User Authentication:
emailregexp = ^[^@]+
emailsuffix = @ourcompanydomain.ca
createemailregexp = .*

Now when using any field which makes use of the "userAutocomplete" functionality, the full username + email suffix is returned when a user is selected from the resulting list.  Next when one attempts to "Save Changes" an error is returned something like:
"Assignee: username@companyDomain.ca did not match anything"

In the code there are two values used, "email" and "real_name", the first of which is used on selection.  I recommend that "email" be replaced with "name".  "name" will actually return an email address if bugzilla uses the default configuration, where-as "name" will return the correct username as well if bugzilla is setup to use local usernames.

I will attach a patch in a following post

Reproducible: Always

Steps to Reproduce:
1. Configure bugzilla to use local usernames
2. Fill out a userAutocomplete field in some random Bug (such as changing Assignee, QA Contact, or appending a user to the CC list)
3. Attempt to "Save Changes"
Actual Results:  
Assignee/QA Contact: user@address.com did not match anything

Expected Results:  
Bug change successful
(Assignee)

Comment 1

6 years ago
Created attachment 519155 [details] [diff] [review]
Patch applied to js/field.js to fix bug

Here is the patch I applied to my system to fix the bug.

Updated

6 years ago
Assignee: general → create-and-change
Status: UNCONFIRMED → NEW
Component: Bugzilla-General → Creating/Changing Bugs
Ever confirmed: true
Flags: blocking4.0.1+
Target Milestone: --- → Bugzilla 4.0
Version: unspecified → 4.0

Updated

6 years ago
Attachment #519155 - Flags: review?(mkanat)

Comment 2

6 years ago
Comment on attachment 519155 [details] [diff] [review]
Patch applied to js/field.js to fix bug

Ah yes, that looks right! Thank you!! :-)
Attachment #519155 - Flags: review?(mkanat) → review+

Updated

6 years ago
Flags: approval4.0+
Flags: approval+

Updated

6 years ago
Assignee: create-and-change → shadarap

Comment 3

6 years ago
It would be nice to do some testing with emailsuffix, I think a lot of people use it.
Flags: testcase?

Comment 4

6 years ago
This patch doesn't apply cleanly, neither on trunk nor on the 4.0 branch, probably due to bug 619637:

Hunk #3 FAILED at 693.

Updated patch needed.

Comment 5

6 years ago
Hey Randy. Could we get a patch that applies to the trunk?
Flags: approval4.0+
Flags: approval+
(Assignee)

Comment 6

6 years ago
Max and Frédéric, sorry I have been super busy at work (others were laid off), I will work on uploading a new patch for the trunk tomorrow.

Comment 7

6 years ago
(In reply to comment #6)
> Max and Frédéric, sorry I have been super busy at work (others were laid off),
> I will work on uploading a new patch for the trunk tomorrow.

  Sounds great, thanks! No problem on the delay, I totally understand.
(Assignee)

Comment 8

6 years ago
Created attachment 524261 [details] [diff] [review]
Patch to apply to js/field.js

Here is the new patch that should work with the trunk.  Note: I have not done any testing of this yet.  If I have time I will try to later today.  The patch should work on the trunk as of today.

P.S. I have never worked with Bazaar before, I should look into this a bit more, seems like a nice tool (from what I have used checking out the trunk).
Attachment #519155 - Attachment is obsolete: true

Comment 9

6 years ago
Comment on attachment 524261 [details] [diff] [review]
Patch to apply to js/field.js

Looks good to me.
Attachment #524261 - Flags: review+

Updated

6 years ago
Flags: approval4.0+
Flags: approval+

Comment 10

6 years ago
(In reply to comment #8)
> P.S. I have never worked with Bazaar before, I should look into this a bit
> more, seems like a nice tool (from what I have used checking out the trunk).

  Cool! Yeah, it's my favorite distributed version control system out of all of them.

Comment 11

6 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified js/field.js
Committed revision 7777.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified js/field.js
Committed revision 7570.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.