MDL-86315 registration: Unset emails in hub when dependant value not set

This commit is contained in:
David Woloszyn
2025-08-15 12:29:26 +10:00
parent e27e1ed7bc
commit 7f38d50aee
+2 -2
View File
@@ -279,11 +279,11 @@ class site_registration_form extends \moodleform {
if ($data = parent::get_data()) {
// Never return '*newemail' checkboxes, always return 'emailalertemail' and 'commnewsemail' even if not applicable.
if (empty($data->emailalert) || empty($data->emailalertnewemail)) {
$data->emailalertemail = null;
$data->emailalertemail = '';
}
unset($data->emailalertnewemail);
if (empty($data->commnews) || empty($data->commnewsnewemail)) {
$data->commnewsemail = null;
$data->commnewsemail = '';
}
unset($data->commnewsnewemail);