Closed (fixed)
Project:
Drupal.org username field
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
27 Aug 2019 at 22:07 UTC
Updated:
8 Jun 2020 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
junkunczWhat is the exact idea here?
Comment #3
prethiee commentedI'm guessing here is to add some custom constraints, validating the username. I used this user_validate_name function from D7 as reference except for requiring username and length, cause I think that the length can be added in the FieldType. Attaching a patch, please take a look into it and let me know if it fits the requirements you're going for.
Comment #4
prethiee commentedComment #5
prethiee commentedComment #6
junkunczHi @prethiee!
Your code looks good to me, and functionality is also fine.
The decision is up to @hussainweb to accept and commit is.
Cheers,
Bálint
Comment #7
hussainwebThanks @prethiee for the patch. I have a few comments below. Apart from that, I assume you took the violations right from the UserName validator?
Let's namespace this id. How about calling it `DoUsernameFormat`?
Extra space here
Extra space here
Extra space here
The indentation is incorrect.
Comment #8
yonas.legesse commentedChanged plugin identifier and checked for indentations.
Comment #9
prethiee commentedThanks for the patch @yonas.legesse, yeah @hussainweb I used D7's user_validate_name function as reference.
Comment #11
hussainwebThanks for all your work here.