#10319 closed defect (bug) (fixed)
WordPress import fails to create new users
Reported by: | yoavf | Owned by: | yoavf |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Import | Keywords: | has-patch early |
Focuses: | Cc: |
Description
When an xml import file contain user names with characters other than [a-z][A-Z], importer still asks if you'd like to import the author.
Problem: Usernames cannot have these characters in them.
The author is not imported, and all posts are mapped to the default user (admin ?)
Possible solutions
- Do not display the "Import Author" line for those usernames
- Display error/warning that the user wasn't imported and that posts were mapped to user "XXX"
Attachments (1)
Change History (18)
#3
@
15 years ago
Saw this investigating #11484.
Nub of the issue is that export files contain display name which is not user_login safe and sanitize_user can strip it down to an empty username.
#4
@
15 years ago
#11548 - Will remove the ability to create duff users but not yet fix the importer.
#6
@
15 years ago
- Cc westi added
- Keywords needs-patch added
- Milestone changed from Future Release to 3.0
That improves this a bit.
Would be great to improve the UX some more in 3.0 to detect the invalid username earlier and offer a better solution that then current fallback.
#7
follow-up:
↓ 8
@
15 years ago
What is an invalid / a valid username? We could create a validation function then and deal accordingly with valid / invalid usernames as needed.
#8
in reply to:
↑ 7
@
15 years ago
Replying to hakre:
What is an invalid / a valid username? We could create a validation function then and deal accordingly with valid / invalid usernames as needed.
It gets passed through sanitize_user($user_login, true)
so the valid name has to match all the rules there.
The big problem at the moment is what to do when the username has no valid chars in it.
I suspect we should modify the first step to show the usernames which will be created and allow the user to change them if no good.
Something like:
Username in import - Username when imported - Use existing user
דיסוננס קוגניטיבי - imported_user_1 (o) [admin\/]
#9
@
15 years ago
sanitize_user($user_login, true)
does not support utf8, allowed chars for a wordpress username are:
WPUSERNAME ::= [a-zA-Z0-9 _.@-]+
while duplicate spaces are not allowed
#13
@
14 years ago
- Keywords has-patch added; needs-patch removed
Why not leave the username field empty for those users?
If the users leave that empty, posts will automatically assigned to the first user.
wp30-import-users.diff does that
#14
@
14 years ago
- Keywords removed
We should still esc_attr it I think. Looks fine to me though. Might be a little late in the development cycle? I suppose all that would be hurt is that more posts would be mapped to users, instead of to the admin.
#16
@
14 years ago
- Resolution set to fixed
- Status changed from assigned to closed
(In [15961]) Importer and exporter overhaul, mega props duck.
Exporter overhaul:
- Add author information to export
- Greater usage of slug identifiers
- Don't export auto-drafts, spam comments, or edit lock/last meta keys
- Inline documentation improvements
- Remove filtering for now (@todo)
- Bump WXR version to 1.1, but remain back compat in the importer
Importer overhaul (http://plugins.trac.wordpress.org/changeset/304249):
- Use an XML parser where available (SimpleXML, XML Parser)
- Proper import support for navigation menus
- Many bug fixes, specifically improvements to category and custom taxonomy handling
- Better author/user mapping
Fixes #5447 #5460 #7400 #7973 #8471 #9237 #10319 #11118 #11144 #11354 #11574 #12685 #13364 #13394 #13453 #13454 #13627 #14306 #14442 #14524 #14750 #15055 #15091 #15108.
See #15197.
Or 3., we sanitize the username accordingly.