MDL-78242 roles: consistently check course contact config.

This commit is contained in:
Paul Holden
2023-05-15 13:04:48 +01:00
parent 017a3274fe
commit 9ef8025e4c
+1 -1
View File
@@ -900,7 +900,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr
// Trigger a purge for all caches listening for changes to category enrolment.
cache_helper::purge_by_event('changesincategoryenrolment');
if (!$CFG->coursecontact || !in_array($roleid, explode(',', $CFG->coursecontact))) {
if (empty($CFG->coursecontact) || !in_array($roleid, explode(',', $CFG->coursecontact))) {
// The role is not one of course contact roles.
return;
}