Why record is inserted if the register is unique ?

13 years 6 months ago #143418 by famq23
Hello Community Builder,

I have a problem with the register form CB, that if a field value (# register) is unique, and do not repeat in the database, ok, then enter the register form in the frontend, if the register value is repeat, show the personalized alert in JS:

[code:1]
function storeNew( $updateNulls = false ) {
$registro = $_POST;

$ok = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );
if ( ! $ok ) {
// $this->_error = strtolower(get_class($this))."::«»storeNew failed: " . $this->_db->getErrorMsg();
$this->_error = " Error: The number of Register is duplicated '".$registro."' , please verify. ";

}
return $ok;
}
[/code:1]

But, continue insert the data but in the table 'jos_users' and not in the table 'jos_comprofiler', and the idea is that if teh number of register is duplicated, stop the insert, and do not insert.

How solve the problem ?

Please Log in to join the conversation.

13 years 6 months ago #143442 by krileon
Don't understand what your issue is. Duplicate userids is not possible within CB and/or Joomla. Please be more specific.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.

Please Log in to join the conversation.

13 years 6 months ago #143676 by famq23
Hello CB,

See, i insert the new field name 'Register' in the CB register form, is unique and number, then the new user complete the form, and compare the field value 'Register' with the field name of the database, if the value is duplicated, show the JS Alert 'Error: The number of Register is duplicated', and this logically should stop, but, the fields (id,name,username, password, ...) is inserted in the table 'jos_users' and the another table 'jos_comprofiler' is not inserted.

The idea is that, if the field value 'Register' is duplicated, this must stop and do not insertar the values in the table 'jos_users'.

Thanks,

Please Log in to join the conversation.

13 years 6 months ago #143813 by krileon
You'll need to create a new CB fieldtype plugin in order to do such validation. None of the existing fields will perform such a validation, sorry. I recommend reviewing documentation subscriber ajax file and text fieldtype plugins as examples for building a new fieldtype plugin.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
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 CST to 4:00 PM CST. 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.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn