Username is too long error on register form

Created on 1 July 2024, 4 months ago

Problem/Motivation

I get an error when submitting the registration form : The username is too long it must be 60 characters or less.

The temporary random username generated looks like email_registration_ea965380-1f7f-443c-b875-4a97346397c5-1b8be43799f877bf9ce1d2a7f67eb52a which always exceeds the max length limit defined in
\Drupal\user\UserInterface::USERNAME_MAX_LENGTH

Drupal 10.3.0
Email registration 2.0.0-rc5

Proposed resolution

I suggest the following patch

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium geoffray

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

Comments & Activities

  • Issue created by @geoffray
  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States greggles Denver, Colorado, USA

    Thanks for the bug report and the patch.

    I tested this out today and wasn't affected by it. I wonder why the uuid is so long on your system. Any ideas?

  • Status changed to Postponed: needs info 3 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    I agree we should find out the reason!
    Still it wouldn't hurt to ensure the generated name is never longer than \Drupal\user\UserInterface::USERNAME_MAX_LENGTH?

Production build 0.71.5 2024