mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 16:40:07 +01:00
MDL-78172 mod_forum: ensure group names are correctly formatted.
This commit is contained in:
parent
76fe404dd5
commit
9ed9a010d6
@ -172,7 +172,7 @@ class author extends exporter {
|
||||
|
||||
return [
|
||||
'id' => $group->id,
|
||||
'name' => $group->name,
|
||||
'name' => format_string($group->name, true, ['context' => $context]),
|
||||
'urls' => [
|
||||
'image' => $imageurl ? $imageurl->out(false) : null,
|
||||
'group' => $groupurl ? $groupurl->out(false) : null
|
||||
|
@ -174,7 +174,7 @@ class discussion extends exporter {
|
||||
// or if it's been deleted and the discussion record hasn't been updated.
|
||||
if ($group) {
|
||||
$groupdata = [
|
||||
'name' => $group->name,
|
||||
'name' => format_string($group->name, true, ['context' => $this->related['context']]),
|
||||
'urls' => [],
|
||||
];
|
||||
|
||||
|
@ -174,7 +174,7 @@ class mod_forum_post_form extends moodleform {
|
||||
// We must make this check because all groups are returned for a visible grouped activity.
|
||||
if (forum_user_can_post_discussion($forum, $groupid, null, $cm, $modcontext)) {
|
||||
// Build the data for the groupinfo select.
|
||||
$groupinfo[$groupid] = $group->name;
|
||||
$groupinfo[$groupid] = format_string($group->name, true, ['context' => $modcontext]);
|
||||
} else {
|
||||
unset($groupdata[$groupid]);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
namespace forumreport_summary\output;
|
||||
|
||||
use context_course;
|
||||
use moodle_url;
|
||||
use renderable;
|
||||
use renderer_base;
|
||||
@ -31,8 +32,6 @@ use stdClass;
|
||||
use templatable;
|
||||
use forumreport_summary;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Forum summary report filters renderable.
|
||||
*
|
||||
@ -186,8 +185,9 @@ class filters implements renderable, templatable {
|
||||
$allowedgroupsobj = $usergroups;
|
||||
}
|
||||
|
||||
$contextcourse = context_course::instance($this->courseid);
|
||||
foreach ($allowedgroupsobj as $group) {
|
||||
$groupsavailable[$group->id] = $group->name;
|
||||
$groupsavailable[$group->id] = format_string($group->name, true, ['context' => $contextcourse]);
|
||||
}
|
||||
|
||||
// Set valid groups selected.
|
||||
|
Loading…
x
Reference in New Issue
Block a user