Problem/Motivation
The field, by default, displays a prefix "https://www.drupal.org/u/". This implies to the user that they need to fill in the username as displayed in the URL. However, the module actually invokes the API to get the user information and hence it needs the actual username. This creates confusion when username is different from the URL slug (for example, when there is a space in the username).
Steps to reproduce
Try adding a username with space or other characters.
Proposed resolution
These are the options:
- Remove the prefix and accept a username.
- Keep the prefix and accept a space. This means we should first read the URL slug to find the user ID.
- Support both cases and give precedence to the actual username and then the URL slug if a user was not found. This could lead to confusion if not clearly communicated.
Remaining tasks
Decide which method to pick.
Comments
Comment #2
abhaysaraf commentedAs the description of the module says that it accepts the D.O usernames. I think our understanding of Drupal username is with the username field value that we have at
/user/{uid}/editpage and it would be a good idea to use it instead of URL slug. I would vote to go with the first proposed option to 'Remove the prefix and accept a username'.Comment #3
nicxvan commentedI think I'd prefer the uid drupal.org/u/nicxvan I would enter nicxvan.
A couple of questions:
Can you get the username from the path so you can hit the api still?
Would you be able to have an update hook that updates existing fields to the uid, I've entered hundreds on https://talkingdrupal.com/guests and would not want to re-enter them.
Comment #4
hussainwebThanks, @nicxvan. You said you'd prefer the UID, but your example indicates a URL.
Also, what have you entered in the fields on the page you linked to? I am guessing you have entered the UID itself and that is why you created #3464064: Usernames with Spaces do not work. Is my understanding correct?
Comment #5
nicxvan commentedSorry, I think I turned myself around.
Ideally I can just copy the path from drupal.org/u/
nicxvan or rajab-natshah