MDL-36778 course - prevent undefined index warnings
[moodle.git] / course / recent_form.php
index dc7fa19..5f35a57 100644 (file)
@@ -99,6 +99,9 @@ class recent_form extends moodleform {
 
             $mform->addElement('select', 'user', get_string('participants'), $options);
             $mform->setAdvanced('user');
+        } else {
+            // Default to no user.
+            $mform->addElement('hidden', 'user', 0);
         }
 
         $options = array(''=>get_string('allactivities'));