Permalink
Browse files

MDL-36778 course - prevent undefined index warnings

When logged in as a guest the mform didn't set userid.
  • Loading branch information...
1 parent 5f1d8f2 commit 4d1383bcf4674e2300a6169b50421d07e55b1342 @danpoltawski danpoltawski committed Nov 30, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 course/recent_form.php
@@ -99,6 +99,9 @@ function definition() {
$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'));

0 comments on commit 4d1383b

Please sign in to comment.