mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-46147 modinfo: performance improvement for course page (check filterall)
This commit is contained in:
parent
0d9805dc14
commit
acbf4579d5
@ -1316,6 +1316,7 @@ class cm_info implements IteratorAggregate {
|
||||
* @return string
|
||||
*/
|
||||
public function get_formatted_name($options = array()) {
|
||||
global $CFG;
|
||||
$options = (array)$options;
|
||||
if (!isset($options['context'])) {
|
||||
$options['context'] = $this->get_context();
|
||||
@ -1323,7 +1324,9 @@ class cm_info implements IteratorAggregate {
|
||||
// Improve filter performance by preloading filter setttings for all
|
||||
// activities on the course (this does nothing if called multiple
|
||||
// times).
|
||||
filter_preload_activities($this->get_modinfo());
|
||||
if (!empty($CFG->filterall)) {
|
||||
filter_preload_activities($this->get_modinfo());
|
||||
}
|
||||
return format_string($this->get_name(), true, $options);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user