Opened 18 months ago
Last modified 5 months ago
#19531 reopened defect (bug)
Wrong error message after correcting an error in username
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | 2nd-opinion has-patch |
| Cc: | xoodrew@… |
Description
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 (1)
Change History (6)
comment:1
SergeyBiryukov — 17 months ago
- Keywords needs-patch added
comment:2
DrewAPicture — 17 months ago
- Cc xoodrew@… added
- Keywords 2nd-opinion close added
- 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.
SergeyBiryukov — 5 months ago
comment:5
SergeyBiryukov — 5 months 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.

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.