Opened 12 years ago
Last modified 3 months ago
#27606 new defect (bug)
"Add Existing User" form does not preserve input in case of an error
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | low |
| Severity: | minor | Version: | |
| Component: | Users | Keywords: | has-patch |
| Focuses: | administration, multisite | Cc: |
Description
Background: #27006
In single site, "Add New User" form preserves entered values in case of an error.
In Multisite, "Add New User" form preserves the values, but "Add Existing User" does not.
In network admin, "Add New User" form does not preserve the values.
Attachments (1)
Change History (10)
#2
@
12 years ago
- Keywords has-patch added
27606.patch fixes the issue.
The case of Network Admin > Add New User was straightforward. The case of Multisite > Add New User was a bit different, because a wp_redirect() takes place after the error, which means we lose the values submitted in $_POST. I've opted to add them as URL parameters when redirecting.
when autocomplete is in use, we really should only allow selection of an option and not the submission of freeform typing
Yes, but that's a bigger fish to fry, so I wrote a fix for the current implementation.
This ticket was mentioned in Slack in #core by jeremyfelt. View the logs.
11 years ago
#4
@
10 years ago
- Component changed from Networks and Sites to Users
- Focuses administration added; multisite removed
- Keywords needs-refresh added
#6
@
10 years ago
foreach ( array( 'username', 'email' ) as $post_key ) {
$$post_key = isset( $_POST['user'][ $post_key ] ) ? stripslashes( $_POST['user'][ $post_key ] ) : '';
}
Should probably avoid variable variables, see [28736] and other commits.
This ticket was mentioned in PR #9407 on WordPress/wordpress-develop by @sainathpoojary.
3 months ago
#9
- Keywords needs-refresh removed
Trac ticket: #27606
We should of course do this on the server side, but when autocomplete is in use, we really should only allow selection of an option and not the submission of freeform typing. See my comment on #19867.