Forums

Receive Systen Emails check box

kmedri 05 Dec, 2011
CF V4rc2 J1.7.3

I have a couple of registration forms that are linked to the Joomla plugin. They work great however for some reason it is checking the 'receive system emails' checkbox. I cannot seem to find anywhere to alter this, am I missing something.

Many thanks
GreyHead 05 Dec, 2011
Hi kmedri ,

Do you have a form input named 'sendEmail'? That's the only way I can see that would set this value.

Bob
kmedri 10 Dec, 2011
I have not added a form field sendEmail and cannot see one, here is the code:
<div class="ccms_form_element cfdiv_text" id="name_container_div"><label>Name</label><input maxlength="150" size="30" class=" validate['required']" title="Name" label_over="0" hide_label="0" type="text" value="" name="pr_name" />
<div class="clear"></div><div id="error-message-pr_name"></div></div><div class="ccms_form_element cfdiv_text" id="username_container_div"><label for="username">Username</label><input id="username" maxlength="150" size="30" class=" validate['required']" title="Username" label_over="0" hide_label="0" type="text" value="" name="pr_username" />
<div class="clear"></div><div id="error-message-pr_username"></div></div><div class="ccms_form_element cfdiv_text" id="email_container_div"><label for="email">Email</label><input id="email" maxlength="150" size="30" class=" validate['required']" title="Email" label_over="0" hide_label="0" type="text" value="" name="pr_email" />
<div class="clear"></div><div id="error-message-pr_email"></div></div><div class="ccms_form_element cfdiv_password" id="enter_password_container_div"><label>Enter Password</label><input maxlength="150" size="30" class=" validate['required']" title="" label_over="0" hide_label="0" type="password" value="" name="pr_password" />
<div class="clear"></div><div id="error-message-pr_password"></div></div><div class="ccms_form_element cfdiv_password" id="confirm_password_container_div"><label>Confirm Password</label><input maxlength="150" size="30" class=" validate['required']" title="Confirm Password" label_over="0" hide_label="0" type="password" value="" name="pr_confirmpassword" />
<div class="clear"></div><div id="error-message-pr_confirmpassword"></div></div><div class="ccms_form_element cfdiv_text" id="childs_name_container_div"><label>Childs Name</label><input maxlength="150" size="30" class=" validate['required']" title="Childs Name" label_over="0" hide_label="0" type="text" value="" name="pr_childname" />
<div class="clear"></div><div id="error-message-pr_childname"></div></div><div class="ccms_form_element cfdiv_textarea" id="address_container_div"><label>Address</label><textarea cols="45" rows="12" class=" validate['required']" title="Address" label_over="0" hide_label="0" type="textarea" name="pr_address"></textarea>
<div class="clear"></div><div id="error-message-pr_address"></div></div><div class="ccms_form_element cfdiv_text" id="city_container_div"><label>City</label><input maxlength="150" size="30" class=" validate['required']" title="City" label_over="0" hide_label="0" type="text" value="" name="pr_city" />
<div class="clear"></div><div id="error-message-pr_city"></div></div><div class="ccms_form_element cfdiv_text" id="postcode_container_div"><label>Postcode</label><input maxlength="150" size="30" class="" title="Postcode" label_over="0" hide_label="0" type="text" value="" name="pr_postcode" />
<div class="clear"></div><div id="error-message-pr_postcode"></div></div><div class="ccms_form_element cfdiv_text" id="telephone_number_container_div"><label>Telephone Number</label><input maxlength="150" size="30" class=" validate['required','number']" title="Telephone Number" label_over="0" hide_label="0" type="text" value="" name="pr_tel" />
<div class="clear"></div><div id="error-message-pr_tel"></div></div><div class="ccms_form_element cfdiv_text" id="mobile_number_container_div"><label>Mobile Number</label><input maxlength="150" size="30" class=" validate['required','number']" title="Mobile Number" label_over="0" hide_label="0" type="text" value="" name="pr_mobile" />
<div class="clear"></div><div id="error-message-pr_mobile"></div></div><div class="ccms_form_element cfdiv_select" id="select_teacher_container_div"><label>Select Teacher</label><select size="1" label_over="0" hide_label="0" class=" validate['required']" title="Select Teacher" type="select" name="pr_teacher">
<option value="" selected>Please Select</option>
	<?php
        if (!$mainframe->isSite() ) {return;}
        $db =& JFactory::getDBO();
        $query = "
        SELECT #__users.id, #__users.name
        FROM #__user_usergroup_map, #__users
        WHERE #__user_usergroup_map.user_id = #__users.id
        AND #__user_usergroup_map.group_id = 10 ;
        ";
        $db->setQuery($query);
        $options = $db->loadAssocList();
        foreach ( $options as $o ) {
        echo "<option value=".$o[id].">".$o[name]."</option>";
        }
        ?>
	</select>
<div class="clear"></div><div id="error-message-pr_teacher"></div></div><div class="ccms_form_element cfdiv_submit" id="input_submit_11_container_div"><input name="input_submit_11" class="" value="Submit" type="submit" />
<div class="clear"></div><div id="error-message-input_submit_11"></div></div>
GreyHead 10 Dec, 2011
Hi kmedri,

Sorry, but I don't have any other suggestions except step by step debugging.

Bob
kmedri 10 Dec, 2011
Not sure if this is where the error is however it seems to be picking up the inputs from a session:

UPDATE `a8at3_session`
SET `data` = '__default|a:9:{s:15:\"session.counter\";i:16;s:19:\"session.timer.start\";i:1323511137;s:18:\"session.timer.last\";i:1323512203;s:17:\"session.timer.now\";i:1323512333;s:22:\"session.client.browser\";s:70:\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0\";s:8:\"registry\";O:9:\"JRegistry\":1:{s:7:\"\0*\0data\";O:8:\"stdClass\":1:{s:5:\"users\";O:8:\"stdClass\":1:{s:5:\"login\";O:8:\"stdClass\":1:{s:4:\"form\";O:8:\"stdClass\":1:{s:4:\"data\";a:0:{}}}}}}s:4:\"user\";O:5:\"JUser\":23:{s:9:\"\0*\0isRoot\";b:1;s:2:\"id\";s:2:\"42\";s:4:\"name\";s:10:\"Super User\";s:8:\"username\";s:6:\"removed\";s:5:\"email\";s:20:\"hidden\";s:8:\"password\";s:65:\"removed\";s:14:\"password_clear\";s:0:\"\";s:8:\"usertype\";s:10:\"deprecated\";s:5:\"block\";s:1:\"0\";s:9:\"sendEmail\";s:1:\"1\";s:12:\"registerDate\";s:19:\"2011-09-01 21:52:11\";s:13:\"lastvisitDate\";s:19:\"2011-12-10 09:58:44\";s:10:\"activation\";s:0:\"\";s:6:\"params\";s:0:\"\";s:6:\"groups
GreyHead 10 Dec, 2011
Hi Kmedri,

Unlikely, that's the User info stored in the session and is you logged in as a SuperUser. That shouldn't get into the info for a new user.

Bob
kmedri 10 Dec, 2011
I cannot see where it is picking up the value "1" for sendMail, this is the array that is being handled:

Array
(
[sr_name] => Kevin Medri
[sr_username] => hidden
[sr_email] => hidden
[sr_password] => hidden
[sr_confirmpassword] => hidden
[rs_submit] => Submit
[989155ef03e05f7a6bd4ecaf3224eff7] => 1
[chronoform] => staff_registration
[event] => submit
[Itemid] => 133
[option] => com_chronoforms
[view] => form
)

And this is where the sendMail is being set:

INSERT INTO `a8at3_users` (`id`,`name`,`username`,`email`,`password`,`usertype`,`block`,`sendEmail`,`registerDate`,`lastvisitDate`,`activation`,`params`)
VALUES ('0','Kevin Medri','hidden','hidden','hidden','deprecated','0','1','2011-12-10 19:15:35','2011-12-10 09:58:44','','{}')
GreyHead 11 Dec, 2011
Hi kmedri ,

I'm wondering if there is some kind of a site default setting? There used to be in Joomla! 1.5 but I don't see one in 1.7

Bob
kmedri 13 Dec, 2011
Still have not found why this is happening, as a temporary fix/hack I have added a line to administrator/components/com_chronoforms/form_actions/joomla_registration/joomla_registration.php to set the sendEmail to '0'

function load($clear){
		if($clear){
			$action_params = array(
				'content1' => '',
				'name' => '',
				'username' => '',
				'email' => '',
				'password' => '',
				'password2' => '',
				'override_allow_user_registration' => 1,
				'new_usertype' => 'Registered',
				'useractivation' => 1,
				'random_password' => 0,
				'sendEmail' => 0,            //added to force sendEmail to no
				'auto_login' => 0,
				'send_joo_activation' => 0,
				'display_reg_complete' => 0

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