MDL-46147 modinfo: performance improvement for course page

This is a big win in a specific situation, ie filters enabled for content+headings,
and no activity descriptions visible on the course page.
This commit is contained in:
Damyon Wiese 2014-06-26 12:15:37 +08:00 committed by Marina Glancy
parent 7a4832ecb9
commit 0d9805dc14

View file

@ -1320,6 +1320,10 @@ class cm_info implements IteratorAggregate {
if (!isset($options['context'])) {
$options['context'] = $this->get_context();
}
// 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());
return format_string($this->get_name(), true, $options);
}