mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-30623 make sure guest password field is not null
This commit is contained in:
parent
42f6b3f1d7
commit
df05b844f6
1 changed files with 16 additions and 0 deletions
|
@ -327,6 +327,22 @@ class enrol_guest_plugin extends enrol_plugin {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new instance of enrol plugin.
|
||||
* @param object $course
|
||||
* @param array instance fields
|
||||
* @return int id of new instance, null if can not be created
|
||||
*/
|
||||
public function add_instance($course, array $fields = NULL) {
|
||||
$fields = (array)$fields;
|
||||
|
||||
if (!isset($fields['password'])) {
|
||||
$fields['password'] = '';
|
||||
}
|
||||
|
||||
return parent::add_instance($course, $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new instance of enrol plugin with default settings.
|
||||
* @param object $course
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue