mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-41809 course: do not rely on page context
page context may not be set, use the correct course context when calling format_string
This commit is contained in:
parent
98c4094eac
commit
212c6861b4
@ -1408,7 +1408,10 @@ class grade_item extends grade_object {
|
||||
$deletionpending = course_module_instance_pending_deletion($this->courseid, $this->itemmodule, $this->iteminstance);
|
||||
$deletionnotice = get_string('gradesmoduledeletionprefix', 'grades');
|
||||
|
||||
return $deletionpending ? format_string($deletionnotice . ' ' . $this->itemname) : format_string($this->itemname);
|
||||
$options = ['context' => context_course::instance($this->courseid)];
|
||||
return $deletionpending ?
|
||||
format_string($deletionnotice . ' ' . $this->itemname, true, $options) :
|
||||
format_string($this->itemname, true, $options);
|
||||
|
||||
} else if ($this->is_course_item()) {
|
||||
return get_string('coursetotal', 'grades');
|
||||
|
Loading…
x
Reference in New Issue
Block a user