Problem/Motivation

If an user has spaces in their username and it is added in the form input field, the link that is created in the display page is formatted incorrectly and takes the user to a wrong page.
Username - John Doe
Current link format - https://www.drupal.org/u/John%20Doe
Expected link format - https://www.drupal.org/u/John-Doe

Steps to reproduce

1. Add any username in the Drupal.org username form field with spaces (eg. John Doe) and save the form.
2. Open the display page and click the Drupal.org username link, it will take the user to a wrong page.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Soham Sengupta created an issue. See original summary.

tyler36 made their first commit to this issue’s fork.

tyler36’s picture

Status: Active » Needs review

Attempt to fix issue.

- trim username of leading and trailign spaces.
- replace other spaces with '-'.

Test with database provider also included. This should allow extra edge cases to be added if required.

hussainweb’s picture

Status: Needs review » Closed (duplicate)

Even though this MR is not merged, I have put in a different fix in #3464064: Usernames with Spaces do not work, adapted the test here, and credited you there. Thanks!