- Go to Administer -> user management -> users
- click edit on any user
- edit the user's email field. update it to some email that IS KNOWN to be already taken on the system by some other user
- click submit
Drupal omits the following message: "The e-mail address is already registered. Have you forgotten your password?".
This is the same message a new user gets when he tries to register with an email already used. In our case, the message should have been something like "Email address already used. You must not use a used email address" (or the like).

As for resolution, I'm contemplating about the desired remedy. There are two options I can think of:
1. the code (user.module, line 1383) should check in what context it is being called - new user registers? somebody adds manually a new user? someone is editing an existing user? etc. Omit output accordingly
2. Create different submit/validate functions for the forms of editing existing users and adding manually a user

I'll be happy to assist with patch creation but this needs further solidification before translated into code.

Comments

mcarbone’s picture

Version: 5.2 » 7.x-dev
Status: Active » Needs review
StatusFileSize
new1.14 KB

I have verified this on HEAD, Drupal 6, and Drupal 5. This is especially a problem because the "Have you forgotten your password?" link leads to an "Access denied" page when logged in. Thus, this message appears erroneously whenever a user is logged in and tries to modify a user's email address. This can happen on /admin/user/user/create or simply on /user/[uid]/edit, if users are able to modify their email address.

The solution, I think, is simply to modify the error message if the user is logged in. I have attached a patch that does this, and will backport for 6 and 5 if it makes it to HEAD.

Status: Needs review » Needs work

The last submitted patch failed testing.

mcarbone’s picture

Status: Needs work » Needs review
StatusFileSize
new1.18 KB

Oops, re-rolled from Drupal root.

catch’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Usability

Nice change.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Let's add a simple code comment. Thanks!

mcarbone’s picture

Status: Needs work » Needs review
StatusFileSize
new1.45 KB

Added comment, and clarified comment above as well.

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks!

mcarbone’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Needs review
StatusFileSize
new1.6 KB

Backported for Drupal 6.

hefox’s picture

Confirming bug in 6, patch applies and looks to work.

thedavidmeister’s picture

Status: Needs review » Needs work
Issue tags: +needs backport to 6.x, +Needs reroll

Patch no longer applies.

curl -0 https://drupal.org/files/issues/user_validate_d6.patch | git apply
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1636  100  1636    0     0    815      0  0:00:02  0:00:02 --:--:--   917
error: user/user.module: No such file or directory

This bug still exists in D6, but not in D7+

Adding tags.

sandipmkhairnar’s picture

Issue summary: View changes
StatusFileSize
new1.42 KB

Re-rolled Patch.

sandipmkhairnar’s picture

Status: Needs work » Needs review

The last submitted patch, 8: user_validate_d6.patch, failed testing.

Alumei’s picture

jacob.embree’s picture

Title: inaccurate/non-informative message when trying to update a user (with email already taken) » Inaccurate/non-informative message when trying to update a user (with email already taken)
Status: Needs review » Reviewed & tested by the community
Issue tags: -needs backport to 6.x, -Needs reroll

#11 works.

Status: Reviewed & tested by the community » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.