Merge branch 'MDL-74784-master' of https://github.com/sarjona/moodle

This commit is contained in:
Jun Pataleta 2022-07-11 16:54:22 +08:00
commit 399a922f0d

View File

@ -208,7 +208,7 @@ class issued_badge implements renderable {
$data->hasrelatedbadges = true;
$data->relatedbadges = [];
foreach ($relatedbadges as $related) {
if (isloggedin() && !is_guest($context)) {
if (isloggedin() && ($context instanceof context_course && !is_guest($context))) {
$related->url = (new moodle_url('/badges/overview.php', ['id' => $related->id]))->out(false);
}
$data->relatedbadges[] = (array)$related;