Decide if we should accept actual username or URL slugs

Created on 16 October 2023, about 1 year ago
Updated 6 August 2024, 5 months ago

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.

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Miscellaneous

Created by

🇨🇦Canada hussainweb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hussainweb
  • 🇮🇳India abhaysaraf

    As 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}/edit page 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'.

  • 🇺🇸United States nicxvan

    I 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.

  • 🇨🇦Canada hussainweb

    Thanks, @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 🐛 Usernames with Spaces do not work Needs review . Is my understanding correct?

  • 🇺🇸United States nicxvan

    Sorry, I think I turned myself around.

    Ideally I can just copy the path from drupal.org/u/
    nicxvan or rajab-natshah

Production build 0.71.5 2024