MDL-78242 roles: consistently check course contact config.

This commit is contained in:
Paul Holden 2023-05-15 12:57:35 +01:00
parent 063ffc8073
commit 69a888cec3
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

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;
}