From de60737dd7d063827e744b5bbac28a0ebadf3504 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 21 Aug 2018 17:28:30 +0800 Subject: [PATCH] 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. --- course/moodleform_mod.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index b38af38a3e9..a3235ce1e00 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -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'); + } } }