[#1991] Username > Field Minimum length of content : 1

9 years 2 months ago #142203 by nicksibbing
Gday Kyle
thanks again. It still doesn't work in 1.2.3 as far as I can tell. I've edited the username field and I still get the same error. I tried it with 2 and also with 0 on the minimum length field. The error comes up either way.

So can you point me to the section in CB where I might be able to hack the code as a workaround until the next version is out.

Thanks for your help.

Regards
Nick Sibbing
9 years 2 months ago #142238 by krileon
Appears to be working perfectly fine within CB 1.2.3. You can check the validation code within plugin.class.php within the class cbFieldHandler followed by the function validate. You can't use a minimum length of 0. Validation is also done on save action of the field in cb.core.php in the class CBfield_predefined.

Post edited by: krileon, at: 2010/09/17 14:50


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
9 years 2 months ago #142296 by nicksibbing
Thanks again Kyle
I guess there must be something different about our installation or perhaps not everything was replaced when I upgraded recently from 1.2.1. (or caching?)

For the record I'm editing an existing user who has a 2 digit username ie 10. The edit fails with the javascript alert error message.

"Please enter a Valid Username:. No spaces, more than 2 characters and contain 0-9,a-z,A-Z"

Like the OP I was able to enter users with 1 and two digit usernames by exporting directly into the database.

I tried a couple of differnet users - no change. Joomla is on 1.5.18. So I'll try again after I upgrade t 1.5.20, which I need to do anyway.

I realise I can't have 0 character usernames but one of the options listed in the tooltip for that field was use 0 to have no minimum

"Minimum length of content (0 = no minimum, empty = default system minimum length"

So I tried them all ie 0 , blank and specifying 2

Thanks again for your help. I'll do more research and see if i can find out what is different about our 1.2.3 installation. (mostly posting in case it helps someone else later)

Regards
Nick Sibbing
9 years 2 months ago #142319 by krileon
Was able to confirm your issue. Field validation is correct, but the JS validation is not based off the parameter which is what is causing this problem. Please see the below quick fixes.

IN: administrator/components/com_comprofiler/views/view.user.php
ON: Line 192
FROM:
[code:1]
} else if (r.exec(me.value) || (me.value.length < 2)) {
[/code:1]
TO:
[code:1]
} else if (r.exec(me.value) || (me.value.length < 1)) {
[/code:1]

The above will fix backend JS validation to validate on any username 1 character or more.

IN: components/com_comprofiler/comprofiler.html.php
ON: Line 316
FROM:
[code:1]
} else if (r.exec(me.value) || (me.value.length < 3)) {
[/code:1]
TO:
[code:1]
} else if (r.exec(me.value) || (me.value.length < 1)) {
[/code:1]

The above will fix frontend JS validation to validate on any username 1 character or more.

Have added a bug ticket for this issue to be addressed in next release, sorry for the inconvenience and thank you for your persistence and help in finding the bug!

#1991


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
9 years 2 months ago #142587 by PtrNrs
There is an additional (cosmetic) change required:-

In components/com_comprofiler/plugin/language/default_language/default_language.php, at line 998 change[code:1]DEFINE('_UE_VALID_UNAME','Please enter a valid username. No spaces, at least 3 characters and contain 0-9,a-z,A-Z');[/code:1]to[code:1]DEFINE('_UE_VALID_UNAME','Please enter a valid username. No spaces, at least 2 characters and contain 0-9,a-z,A-Z');[/code:1]I'm afraid I have to mark CB down for not using a single parameter here. I hope this is fixed in a forthcoming version.
Moderators: beatnantkrileon
Time to create page: 0.418 seconds
Facebook Twitter Google LinkedIn