On duplicate usernames concatenate the suffix without a space

mlsamuelson - November 12, 2009 - 22:44
Project:User Import
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Spaces in usernames is something you don't see much in software other than Drupal. I'd recommend that when a duplicate username is found, that the numerical suffix concatenated to the end of the new username does not have a space in front of it.

I'm working with a site that automatically creates a Google Account when a new user is created. Google errors out when there are spaces in the username... Just an example of why sticking with the more standard "no space username" is probably a good idea.

I see two ways to do this:
1. Change the code that checks and builds usernames in _user_import_unique_username().
2. Add the $username_space value as a parameter on _user_import_unique_username() as $username_space is available in _user_import_create_username() where _user_import_unique_username() is called, and tie the space/no space behavior into that, so the user can decide.

#1

mlsamuelson - November 12, 2009 - 22:49
Status:active» needs review

Here's a patch that takes the option 1 approach.

AttachmentSize
user_import-631408-1.patch 1.05 KB
 
 

Drupal is a registered trademark of Dries Buytaert.