Created attachment 568446 [details] username01 Description of problem: 1. User Name in New Staff: a) when type user name with first letter capital, message "The "User Name" field must start with a character" occur (attachment username01.png) b) when type user name with invalid characters, message looks like "msg msg Ivalid-char Invalid-char" (attachment username02.png) 2. Group Name when adding new group in Users and Groups Management: When type invalid characters, warning contains message too many times (groupName.png) (3. User Name field when putting user into Group: When typing "a*****", message says User "a*****" doesn't exist. I'm not sure if better message is warning that says username contains invalid characters. (usernameInGroupMan.png))
Created attachment 568447 [details] username02
Created attachment 568448 [details] groupName
Created attachment 568449 [details] usernameInGroupMan
The problem comes from the error message for the first issue. It needs to be localized properly, I can fix the en and fr versions. Still looking at the other issues.
Looking at the code, it looks like the new version of the validation is more permissive (allows different case apart from the initial character which must be lowercase) than what was previously allowed (only lowercase letters). So I first need to go back to the original behavior (post 5.1, I think). Also, the error messages are currently wrong with respect to what's being done in the code. The English version is incorrect and the French version also. Also, not only are the fr and en versions incorrect but they also contradict one another so localized versions of the error messages would need to be checked for error and coherence between versions.
For the second part, part of the issue is how messages errors are now handled (validation now goes through fully instead of failing fast which means you can now see all the errors at once instead of trying 20 times to get the format right). I will fix the reporting so that it doesn't report the same error several times. The other part of the problem is resource resolving: the localization keys are not properly resolved for a reason unknown to me at the moment. Will look at it later.
I have fixed all issues except for the 3rd one, which comes directly from eXo: it wasn't working before my change and it's not working now. The problem is that usernames when they are put into a group are validated via a regular expression which does allow a username such as a*****. This results in the validator moving on and accepting the username as valid and thus, looking for it at a later validation stage.
Chris Laprun <chris.laprun> made a comment on jira GTNPORTAL-2378 The problem is that usernames when they are put into a group are validated via a regular expression which does allow a username such as a*****. This results in the validator moving on and accepting the username as valid and thus, looking for it at a later validation stage.
Chris Laprun <chris.laprun> updated the status of jira GTNPORTAL-2378 to Resolved
Chris Laprun <chris.laprun> updated the status of jira GTNPORTAL-2377 to Resolved
Should be done now, please check.