From 71be1d66e90393196c8c04a219e51fb75725d539 Mon Sep 17 00:00:00 2001 From: Nicolas Alexandropoulos Date: Tue, 12 Nov 2024 12:08:56 +0100 Subject: [PATCH 1/2] Display no groups warning only on activity settings page (issue #214) --- mod_form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod_form.php b/mod_form.php index 3935a7a..377b72e 100644 --- a/mod_form.php +++ b/mod_form.php @@ -75,7 +75,8 @@ public function definition() { $groups[$group->id]->id = $group->id; } - if (count($dbgroups) < 1) { + //Display warning if no groups are set + if ($PAGE->pagetype === 'mod-choicegroup-mod' && count($dbgroups) < 1) { $a = new stdClass(); $a->linkgroups = $CFG->wwwroot . '/group/index.php?id=' . $COURSE->id; $a->linkcourse = $CFG->wwwroot . '//course/view.php?id=' . $COURSE->id; From 73dc4a883855c5efb6e58370dd80ad222295e802 Mon Sep 17 00:00:00 2001 From: Nicolas Alexandropoulos Date: Tue, 12 Nov 2024 12:51:46 +0100 Subject: [PATCH 2/2] Fix code checker issues --- mod_form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_form.php b/mod_form.php index 377b72e..22cad4c 100644 --- a/mod_form.php +++ b/mod_form.php @@ -75,7 +75,7 @@ public function definition() { $groups[$group->id]->id = $group->id; } - //Display warning if no groups are set + // Display warning if no groups are set. if ($PAGE->pagetype === 'mod-choicegroup-mod' && count($dbgroups) < 1) { $a = new stdClass(); $a->linkgroups = $CFG->wwwroot . '/group/index.php?id=' . $COURSE->id;