mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
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.
This commit is contained in:
parent
88cd577ef3
commit
8ef7eade79
1 changed files with 1 additions and 1 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue