MDL-67930 mod_forum: consistent default group image when hidden.

This commit is contained in:
Paul Holden 2020-03-13 20:42:37 +00:00
parent f2fc4a9fa1
commit 3e1b05f001

View File

@ -178,13 +178,13 @@ class discussion extends exporter {
'urls' => [],
];
if (!$group->hidepicture) {
$url = get_group_picture_url($group, $forum->get_course_id(), true);
if (empty($url)) {
// Get a generic group image URL.
$url = $output->image_url('g/g1')->out(false);
}
// If not hiding the group picture, and the group has a picture then use it. Fallback to generic group image.
if (!$group->hidepicture &&
($url = get_group_picture_url($group, $forum->get_course_id(), true))) {
$groupdata['urls']['picture'] = $url;
} else {
$groupdata['urls']['picture'] = $output->image_url('g/g1')->out(false);
}
if ($capabilitymanager->can_view_participants($user, $discussion)) {