From 57429ec39bd9cc401f58ac14d8d1281e8e126a84 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 69dae685551..d513aec75c3 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'); + } } }