User tests: Successful: Unsuccessful:
Pull Request for Issue #28739 .
Added info to the error message to explain the length limit for the username
The error message...
Please enter a valid username. No space at beginning or end, at least %d characters, must not have the following characters: < > \ " ' % ; ( ) & and be less than 150 characters long.
I don't think so, looking at https://docs.joomla.org/Help39:Users_User_Manager
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings |
I have tested this item
Tested on review.
@zero-24 I don't really understand where the 150 limit is from, I can see why 190 would needed, with it being 767bytes. I'm not sure how encoding changes the character length and byte size.
From making idx_username / username unique in...
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/sql/updates/mysql/3.9.16-2020-03-04.sql
ALTER TABLE `#__users` DROP INDEX `username`;
ALTER TABLE `#__users` ADD UNIQUE INDEX `idx_username` (`username`);
There is also some related info on https://docs.joomla.org/J3.x:Duplicate_usernames_cause_update_issue
Can you try to avoid having & and
next to each other in the string please
The limit was added by JSST
cf25340#diff-63df7217041c8857319443eaa2abcf67
Ah now i remember. LGTM than
As an aside, the 150 character limit is quite problematic for us, as we use Firebase Cloud messaging tokens as Joomla usernames, and they seem to always be 153 characters long.
It's a thing we can work around, storing the FCM token in a different field, but it's caused some issues in our API and registration systems as is.
@brianteeman re...
Can you try to avoid having & and next to each other in the string please
...I did have a good think about the wording, and I know what you mean re this.
So, in the PR it is...
"Please enter a valid username. No space at beginning or end, at least %d characters, must not have the following characters: < > \ " ' % ; ( ) & and be less than 150 characters long."
The two alternatives I thought of were...
Putting quotes round each of the illegal characters, but that would be quotes round quotes, so kind of horrible.
Using something other than "and" there, like "also" or "additionally", but I felt that sounded kind of clunky.
Alternative wording suggestions would be gratefully received though.
Just moving the &
among the other special chars would fit I guess, but let's wait a bit.
Just discussing in JSST to eventually change this to 154 or 256 chars.
The username is 150 characters in...
https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L2060
...so it would have to change there too, and I guess in an update sql files.
I think the 767 bytes is limitation for InnoDB tables in MySQL version 5.6, for unique keys. So that would be 255 characters in utf8 and 191 in utf8mb4.
I was reading some of the answers on https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes
I have tested this item
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-25 16:59:48 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
?
|
Merged thanks.
Thanks @obuisard, @zero-24, @infograf768, @Quy and @brianteeman for your comments and tests on this PR
Did you checked where the limit of 150 is comming from?