BP adding -2 when spaces are included in username
-
I hope someone can help me. I’m running into this problem, mentioned in this ticket:
http://trac.buddypress.org/ticket/2642
Essentially, every time a new user registers, they have a -2 added to their username. So when someone clicks on their profile link which doesn’t contain the -2 at the end, it redirects to the front page because the system doesn’t recognize the username.
I believe it’s already discussed here:
However, no workaround or solution was proposed. Is there a fix? Patch? Workaround? It’s becoming tedious for me to get into my database each time someone registers in order to remove the -2 at the end of their username.
-
Is there someone who we can hire to fix this? It’s important that we fix this ASAP as our marketing campaign has just begun.
@r-a-y do you have any ideas? Thank you for any help anyone can bring.
Michel, this forum is quietest at weekends. Please allow a day or two before re-posting to a topic; if you haven’t had a response, then people probably don’t have an answer.
As you can tell from the trac ticket you found, when it was previously reported, no-one figured out exactly why this was happening, so we couldn’t fix it. Looking at a comment on the ticket now, someone seems to think that if you put the following line into your theme’s functions.php, it might resolve the issue:
remove_action( 'pre_user_login', 'bp_core_strip_username_spaces' );
If the ticket covers the same problem that you have, this might be a fix. You can tell by creating a new user account once you’ve put that into your functions.php. I cannot guarantee that this would not cause any other issues. Indeed, I can’t understand why BuddyPress does this anyway, without spending a couple of hours investigating.
The issue seems to be the presence of spaces in the username/log in name. If this does fix your issue, please would you give us a sample of username/log in name so I can investigate.
Oh, I didn’t know there were times to post. Sorry. I did post the first time several days ago during the week (not as a forum post but as a group post, which I didn’t know and was confusing — and which is why I reposted, simply because I thought I posted in the wrong area). Then, the lack of answer led me to believe no one knew the answer (as you said), which is why, being an urgent situation, I was fully prepared to hire someone and added the 2nd comment.
And yes, this seems to be the case. The usernames that are problematic are those with spaces, which is why — as a temp fix — I added a note to the registration form telling people to NOT use spaces.
I’ll add the fix and report back.
- The topic ‘BP adding -2 when spaces are included in username’ is closed to new replies.