MDL-60145 course: fix bug with group restictions button during mod edit

If a mod doesn't support groups, then we remove the grouping element,
and now also the 'add group/group restriction' helper button too.
This commit is contained in:
Jake Dallimore 2018-08-21 17:28:30 +08:00
parent 129783b98c
commit de60737dd7

View File

@ -290,6 +290,10 @@ abstract class moodleform_mod extends moodleform {
if ($mform->elementExists('groupingid')) {
$mform->removeElement('groupingid');
}
// Nor does the group restrictions button.
if ($mform->elementExists('restrictgroupbutton')) {
$mform->removeElement('restrictgroupbutton');
}
}
}