Make WordPress Core

Opened 3 years ago

Last modified 10 days ago

#19531 reopened defect (bug)

Wrong error message after correcting an error in username

Reported by: wimfeijen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: close
Focuses: Cc:


After entering an illegal username (fe. "Wim (wim@…)"), WordPress gives an error message saying:
"ERROR: This username is invalid because it uses illegal characters. Please enter a valid username."
So far so good.

Now, when I correct the issue and click "Add new user" again, the above error message remains in the screen, while the illegal characters are no longer there and the actual error I am facing is that I forgot my password. Which is confusing for me.

The same occurs, when I enter an e-mail which has already been registered. I get the error message:
"ERROR: This email is already registered, please choose another one."
When I correct, the error message remains, while this particular problem has been solved.

WP v: 3.3
Browser: Google Chrome 14.0 on Ubuntu 11.10

Attachments (2)

19531.patch (554 bytes) - added by SergeyBiryukov 2 years ago.
19531.2.diff (561 bytes) - added by MikeHansenMe 11 days ago.
refreshed from src dir

Download all attachments as: .zip

Change History (8)

comment:1 @SergeyBiryukov3 years ago

  • Keywords needs-patch added

comment:2 @DrewAPicture3 years ago

  • Cc xoodrew@… added
  • Keywords 2nd-opinion close added

I believe that this is currently expected behavior, clunky as it may be.

If I'm grasping this correctly, a $_POST error (generated via server-side validation) will persist as long as long as one of the four required inputs (user_login, email, pass1 or pass2) is empty. This is because the asynch validation prevents the form from updating the $_POST data until they all hold some kind of value regardless of integrity. E.g., ajax checks for a value, server checks for integrity of the value.

So unless somebody wants to tackle asynchronous server-side $_POST validation, I suggest closing as wontfix or maybelater.

comment:3 @bkerensa2 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

Marking this maybelater as I concur with @DrewAPicture that we would need to tackle async server-side validation or find another work around.

comment:4 @helen2 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted

@SergeyBiryukov2 years ago

comment:5 @SergeyBiryukov2 years ago

  • Component changed from General to Administration
  • Keywords has-patch added; needs-patch removed
  • Milestone set to Awaiting Review
  • Resolution maybelater deleted
  • Status changed from closed to reopened

A workaround might be to hide div.error along with adding form-invalid class in wpAjax.invalidateForm() when trying to submit an incomplete form.

@MikeHansenMe11 days ago

refreshed from src dir

comment:6 @chriscct710 days ago

  • Keywords close added; 2nd-opinion has-patch removed

This works fine for me on trunk. When you correct the username and forget to do the password, the password field is lit up to remind you to put in a password. If you bypass this check by removing the field-required class, on refresh you get a "ERROR: Please enter your password." notice. Someone must have fixed this since then.

Thinking close as worksforme

Note: See TracTickets for help on using tickets.