From fc4ef8e60029e962a451ab620759a35e8919f258 Mon Sep 17 00:00:00 2001 From: Robert Garrigos Date: Mon, 7 Nov 2022 16:27:25 +0100 Subject: [PATCH 1/3] Fixes #18 --- profile.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/profile.module b/profile.module index be9afeb..9a29d3d 100644 --- a/profile.module +++ b/profile.module @@ -753,7 +753,7 @@ function profile_form_validate_handler(&$form, &$form_state) { * @see profile_attach_form() */ function profile_form_before_user_register_submit_handler(&$form, &$form_state) { - global $conf; + $config = config('system.core'); // List of available operations during the registration. $register_ops = array('register_admin_created', 'register_no_approval_required', 'register_pending_approval'); @@ -769,7 +769,7 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state) } // Temporary disable the notification about registration. - $conf['user_mail_' . $op . '_notify'] = FALSE; + $config->set('user_mail_' . $op . '_notify', FALSE); } } @@ -785,7 +785,7 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state) * @see profile_attach_form() */ function profile_form_after_user_register_submit_handler(&$form, &$form_state) { - global $conf; + $config = config('system.core'); // List of registration operations that where // notification values were changed. @@ -802,7 +802,7 @@ function profile_form_after_user_register_submit_handler(&$form, &$form_state) { } // Otherwise just remove this value from a global variables array. else { - unset($conf['user_mail_' . $op . '_notify']); + $config->set('user_mail_' . $op . '_notify', TRUE); } } From 36ccdf58f2885b9b010b9a459c19cb2d278776ce Mon Sep 17 00:00:00 2001 From: Robert Garrigos Date: Mon, 7 Nov 2022 16:42:09 +0100 Subject: [PATCH 2/3] Addes some changes missed to fix #18 --- .vscode/settings.json | 5 +++++ profile.module | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5b05eec --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "1.x-1.x" + ] +} \ No newline at end of file diff --git a/profile.module b/profile.module index 9a29d3d..40e1322 100644 --- a/profile.module +++ b/profile.module @@ -764,8 +764,8 @@ function profile_form_before_user_register_submit_handler(&$form, &$form_state) foreach ($register_ops as $op) { // Save variable value. - if (isset($conf['user_mail_' . $op . '_notify'])) { - $changed_ops['user_mail_' . $op . '_notify'] = $conf['user_mail_' . $op . '_notify']; + if ($config->get('user_mail_' . $op . '_notify')) { + $changed_ops['user_mail_' . $op . '_notify'] = $config->get('user_mail_' . $op . '_notify'); } // Temporary disable the notification about registration. @@ -798,7 +798,7 @@ function profile_form_after_user_register_submit_handler(&$form, &$form_state) { // If we changed the notification value in // profile_form_before_user_register_submit_handler() then change it back. if (isset($changed_ops['user_mail_' . $op . '_notify'])) { - $conf['user_mail_' . $op . '_notify'] = $changed_ops['user_mail_' . $op . '_notify']; + $config->set('user_mail_' . $op . '_notify', $changed_ops['user_mail_' . $op . '_notify']); } // Otherwise just remove this value from a global variables array. else { From 8b56392c256dcf6d91173d4ddf9bc9f428ecca50 Mon Sep 17 00:00:00 2001 From: Robert Garrigos Date: Mon, 7 Nov 2022 16:47:24 +0100 Subject: [PATCH 3/3] Delete settings.json --- .vscode/settings.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 5b05eec..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "githubPullRequests.ignoredPullRequestBranches": [ - "1.x-1.x" - ] -} \ No newline at end of file