? ? Pending

User tests: Successful: Unsuccessful:

avatar AndyGaskell
AndyGaskell
21 Apr 2020

Pull Request for Issue #28739 .

Summary of Changes

Added info to the error message to explain the length limit for the username

Testing Instructions

  1. Go to https:///administrator/index.php?option=com_users&view=user&layout=edit
  2. Enter details...
    Name: test
    Login Name: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    Password: anything
    Confirm Password: anything
    Email: test@example.com
  3. Click "Save"

Expected result

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.

Documentation Changes Required

I don't think so, looking at https://docs.joomla.org/Help39:Users_User_Manager

avatar AndyGaskell AndyGaskell - open - 21 Apr 2020
avatar AndyGaskell AndyGaskell - change - 21 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Apr 2020
Category Administration Language & Strings
avatar zero-24
zero-24 - comment - 21 Apr 2020

Did you checked where the limit of 150 is comming from?

avatar infograf768
infograf768 - comment - 21 Apr 2020

I have tested this item successfully on 6a96628

Tested on review.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28741.

avatar infograf768 infograf768 - test_item - 21 Apr 2020 - Tested successfully
avatar AndyGaskell
AndyGaskell - comment - 21 Apr 2020

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

Like this error
error_char_limt

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

avatar brianteeman
brianteeman - comment - 21 Apr 2020

Can you try to avoid having & and next to each other in the string please

avatar infograf768
infograf768 - comment - 21 Apr 2020

The limit was added by JSST
cf25340#diff-63df7217041c8857319443eaa2abcf67

avatar zero-24
zero-24 - comment - 21 Apr 2020

Ah now i remember. LGTM than ?

avatar AndyGaskell
AndyGaskell - comment - 21 Apr 2020

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.

avatar AndyGaskell
AndyGaskell - comment - 21 Apr 2020

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

  1. Putting quotes round each of the illegal characters, but that would be quotes round quotes, so kind of horrible.

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

avatar infograf768
infograf768 - comment - 21 Apr 2020

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.

avatar AndyGaskell
AndyGaskell - comment - 21 Apr 2020

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

avatar obuisard
obuisard - comment - 25 Apr 2020

I have tested this item successfully on 6a96628


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28741.

avatar obuisard obuisard - test_item - 25 Apr 2020 - Tested successfully
avatar zero-24 zero-24 - change - 25 Apr 2020
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: ? ?
avatar zero-24 zero-24 - close - 25 Apr 2020
avatar zero-24 zero-24 - merge - 25 Apr 2020
avatar zero-24
zero-24 - comment - 25 Apr 2020

Merged thanks. ?

avatar AndyGaskell
AndyGaskell - comment - 29 Apr 2020

Thanks @obuisard, @zero-24, @infograf768, @Quy and @brianteeman for your comments and tests on this PR ?

Add a Comment

Login with GitHub to post a comment