Fix #73 - Debug warnings when adding session for "Separate groups" if no groups defined
authorBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Fri, 13 Feb 2015 10:30:12 +0000 (10:30 +0000)
committerBarry Oosthuizen <barry.oosthuizen@nottingham.ac.uk>
Tue, 26 May 2015 16:08:52 +0000 (17:08 +0100)
add_form.php

index a9550a3..fdfa06b 100644 (file)
@@ -91,7 +91,9 @@ class mod_attendance_add_form extends moodleform {
                 $select->setMultiple(true);
                 $mform->disabledIf('groups', 'sessiontype', 'neq', attendance::SESSION_GROUP);
             } else {
-                $mform->updateElementAttr($radio, array('disabled'=>'disabled'));
+                if ($groupmode == VISIBLEGROUPS) {
+                    $mform->updateElementAttr($radio, array('disabled'=>'disabled'));
+                }
                 $mform->addElement('static', 'groups', get_string('groups', 'group'),
                                   get_string('nogroups', 'attendance'));
                 if ($groupmode == SEPARATEGROUPS) {