From 722e179f305bf57977be1ce84e1c9d2871a22a7a Mon Sep 17 00:00:00 2001 From: John Okely Date: Mon, 2 Feb 2015 11:54:21 +0800 Subject: [PATCH] MDL-42138 user: Require custom profile fields when registering as guest Previously when someone registers after logging in as a guest, required custom profile fields would not be required. Thanks to Andreas Diendorfer for providing the patch. --- user/profile/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/profile/lib.php b/user/profile/lib.php index 5a040aa609d..1e2f954d7e2 100644 --- a/user/profile/lib.php +++ b/user/profile/lib.php @@ -210,7 +210,7 @@ class profile_field_base { */ public function edit_field_set_required($mform) { global $USER; - if ($this->is_required() && ($this->userid == $USER->id)) { + if ($this->is_required() && ($this->userid == $USER->id || isguestuser())) { $mform->addRule($this->inputname, get_string('required'), 'required', null, 'client'); } } -- 2.11.4.GIT