Forums

CB registration doesn't work

Rafifi 31 Oct, 2014
Hello everybody!

I start with Chronoforms and i can't success create registration form with Community Builder support. I activate CB support in the joomla registration blue block processus but new user is only created in the users table, not in the comprofiler table...

I looked into the joomla_registration.php file to understand where is the problem. Why this part is in comment?

/*$database->setQuery( "INSERT INTO #__comprofiler (".implode(",", $default_fields_names).") VALUES  ('".implode("','", $form->escapeVar($default_fields_values))."');" );
			if (!$database->query()) {
				JError::raiseWarning(100, $database->getErrorMsg());
			}*/


I tried to erase the comments tags but an error about escapeVar appeared.

Thanks to send me in the right way...
Max_admin 31 Oct, 2014
Hi Rafifi,

No users have asked for CB support and so it has been disabled.

Please send me a message using the "Contact us" page to get an action patch file which would solve this issue, this may take few days to finish though.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Rafifi 31 Oct, 2014
Answer
Thanks Max.

But it's ok, I finaly tried simple custom code after joomla registration and ... It's fine :

<?php
$user =& JFactory::getUser();
$form->data['id'] = $user->id;
$database = JFactory::getDBO();
$database->setQuery( "INSERT INTO #__comprofiler (id,user_id) VALUES  ('".$user->id."','".$user->id."')" );
			
if (!$database->query()) {
				JError::raiseWarning(100, $database->getErrorMsg());
			}
			
?>


Users complete firstname, lastname ... in the second page of my forms.

Long life to ChronoForms !
Max_admin 31 Oct, 2014
Well done, and thanks for sharing the code!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
efh68 01 Dec, 2014
I tried the custom code above and placed it after the joomla registration, but I am still not getting the CB user management populated with the new subscribers. Do I need to modify the code above to work with my registration form?

Thanks,
Ed
BNDragon 02 Dec, 2014
Dear all,

I don't think that code work. Well,
$user =& JFactory::getUser();

If you are register an user, this code will return 0, because the user is not logged, so I'll suggest take the value from form, some like:
$id = $form->data['_PLUGINS_']['joomla_registration']['id'];



@Ed
Rafifi code only insert the id on cb, so you need to complete the query.

BN
This topic is locked and no more replies can be posted.