MDL-63683 enrol: Fix plugin settings when no role has student archetype
[moodle.git] / enrol / mnet / settings.php
index fc7517f..c74c8e1 100644 (file)
@@ -36,6 +36,6 @@ if ($ADMIN->fulltree) {
         $student = reset($student);
         $settings->add(new admin_setting_configselect_with_advanced('enrol_mnet/roleid',
             get_string('defaultrole', 'role'), '',
-            array('value'=>$student->id, 'adv'=>true), $options));
+            array('value' => $student->id ?? null, 'adv' => true), $options));
     }
 }