Skip to content

Commit ca02cfc

Browse files
authored
Merge pull request #19 from robertgarrigos/1.x-1.x
Fixes #18.
2 parents 22e73dc + 8b56392 commit ca02cfc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

profile.module

+7-7
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ function profile_form_validate_handler(&$form, &$form_state) {
753753
* @see profile_attach_form()
754754
*/
755755
function profile_form_before_user_register_submit_handler(&$form, &$form_state) {
756-
global $conf;
756+
$config = config('system.core');
757757

758758
// List of available operations during the registration.
759759
$register_ops = array('register_admin_created', 'register_no_approval_required', 'register_pending_approval');
@@ -764,12 +764,12 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state)
764764
foreach ($register_ops as $op) {
765765

766766
// Save variable value.
767-
if (isset($conf['user_mail_' . $op . '_notify'])) {
768-
$changed_ops['user_mail_' . $op . '_notify'] = $conf['user_mail_' . $op . '_notify'];
767+
if ($config->get('user_mail_' . $op . '_notify')) {
768+
$changed_ops['user_mail_' . $op . '_notify'] = $config->get('user_mail_' . $op . '_notify');
769769
}
770770

771771
// Temporary disable the notification about registration.
772-
$conf['user_mail_' . $op . '_notify'] = FALSE;
772+
$config->set('user_mail_' . $op . '_notify', FALSE);
773773
}
774774
}
775775

@@ -785,7 +785,7 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state)
785785
* @see profile_attach_form()
786786
*/
787787
function profile_form_after_user_register_submit_handler(&$form, &$form_state) {
788-
global $conf;
788+
$config = config('system.core');
789789

790790
// List of registration operations that where
791791
// notification values were changed.
@@ -798,11 +798,11 @@ function profile_form_after_user_register_submit_handler(&$form, &$form_state) {
798798
// If we changed the notification value in
799799
// profile_form_before_user_register_submit_handler() then change it back.
800800
if (isset($changed_ops['user_mail_' . $op . '_notify'])) {
801-
$conf['user_mail_' . $op . '_notify'] = $changed_ops['user_mail_' . $op . '_notify'];
801+
$config->set('user_mail_' . $op . '_notify', $changed_ops['user_mail_' . $op . '_notify']);
802802
}
803803
// Otherwise just remove this value from a global variables array.
804804
else {
805-
unset($conf['user_mail_' . $op . '_notify']);
805+
$config->set('user_mail_' . $op . '_notify', TRUE);
806806
}
807807
}
808808

0 commit comments

Comments
 (0)