MDL-49412 navigation: Isset check on email setting.

The messaging preferences doesn't always seem to show the
email settings during behat tests and when updating details
will throw a warning.

Part of MDL-45774.
This commit is contained in:
Adrian Greeve 2015-04-09 10:24:32 +08:00
parent ef67967293
commit 06347532f0

View File

@ -130,7 +130,9 @@ if (($form = data_submitted()) && confirm_sesskey()) {
print_error('cannotupdateusermsgpref');
}
$user->mailformat = clean_param($form->mailformat, PARAM_INT);
if (isset($form->mailformat)) {
$user->mailformat = clean_param($form->mailformat, PARAM_INT);
}
user_update_user($user, false, false);
redirect("$CFG->wwwroot/message/edit.php?id=$user->id");